ilog.views.maps.format
Class IlvMapInput

java.lang.Object
  extended by ilog.views.maps.format.IlvMapInput

public final class IlvMapInput
extends Object

This class defines an input stream with extended reading capabilities.

Since:
ILOG JViews 3.0

Constructor Summary
IlvMapInput(DataInput input)
          Initializes an instance of IlvMapInput.
 
Method Summary
 long getIndex()
          Returns the current index in the stream.
 DataInput getInput()
          Returns the input data.
 void read(byte[] data, int off, int length)
          Reads up to length bytes of data from the specified file and stores it in a byte array.
 double readBigDouble()
          Reads a 64-bit IIIE double coded in big endian format.
 int readBigInt()
          Reads a 32-bit integer coded in big endian format.
 short readBigShort()
          Reads a 16-bit integer coded in big endian format.
 long readBigUnsignedInt()
          Reads a 32-bit unsigned integer coded in big endian format.
 int readBigUnsignedShort()
          Reads a 16-bit unsigned integer coded in big endian format.
 byte readByte()
          Reads and returns one input byte.
 double readLittleDouble()
          Reads a 64-bit IIIE double coded in little endian format.
 int readLittleInt()
          Reads a 32-bit integer coded in little endian format.
 short readLittleShort()
          Reads a 16-bit integer coded in little endian format.
 int readUnsignedByte()
          Reads an unsigned byte.
 void setLocation(long loc)
          Sets the location where the next read operation will occur to the specified index.
 int skipBytes(int n)
          Skips exactly n bytes of input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvMapInput

public IlvMapInput(DataInput input)
Initializes an instance of IlvMapInput.

Parameters:
input - The input data.
Method Detail

getInput

public final DataInput getInput()
Returns the input data.


readUnsignedByte

public final int readUnsignedByte()
                           throws IOException
Reads an unsigned byte.

Throws:
IOException

readLittleDouble

public final double readLittleDouble()
                              throws IOException
Reads a 64-bit IIIE double coded in little endian format.

Throws:
IOException - If an exception occurs while reading the data.

readBigDouble

public final double readBigDouble()
                           throws IOException
Reads a 64-bit IIIE double coded in big endian format.

Throws:
IOException - If an exception occurs while reading the data.

readLittleInt

public final int readLittleInt()
                        throws IOException
Reads a 32-bit integer coded in little endian format.

Throws:
IOException - If an exception occurs while reading the data.

readBigInt

public final int readBigInt()
                     throws IOException
Reads a 32-bit integer coded in big endian format.

Throws:
IOException - If an exception occurs while reading the data.

readBigUnsignedInt

public final long readBigUnsignedInt()
                              throws IOException
Reads a 32-bit unsigned integer coded in big endian format.

Throws:
IOException - If an exception occurs while reading the data.

readLittleShort

public final short readLittleShort()
                            throws IOException
Reads a 16-bit integer coded in little endian format.

Throws:
IOException - If an exception occurs while reading the data.

readBigShort

public final short readBigShort()
                         throws IOException
Reads a 16-bit integer coded in big endian format.

Throws:
IOException - If an exception occurs while reading the data.

readBigUnsignedShort

public final int readBigUnsignedShort()
                               throws IOException
Reads a 16-bit unsigned integer coded in big endian format.

Throws:
IOException - If an exception occurs while reading the data.

skipBytes

public final int skipBytes(int n)
                    throws IOException
Skips exactly n bytes of input.

Parameters:
n - The number of bytes to be skipped.
Returns:
The number of bytes skipped, which is always n.
Throws:
IOException - If the end of this stream is reached before all the bytes have been skipped or if the argument is negative and the backward seeking is not supported.

setLocation

public final void setLocation(long loc)
                       throws IOException
Sets the location where the next read operation will occur to the specified index.

Parameters:
loc - The index where the next read operation will occur.
Throws:
IOException - If an errors occurs while setting location.
See Also:
getIndex()

getIndex

public final long getIndex()
Returns the current index in the stream.


read

public final void read(byte[] data,
                       int off,
                       int length)
                throws IOException
Reads up to length bytes of data from the specified file and stores it in a byte array.

Throws:
IOException - If an exception occurs while reading the data.

readByte

public final byte readByte()
                    throws IOException
Reads and returns one input byte.

Throws:
IOException - If an exception occurs while reading the data.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.