net.arnx.wmf2svg.io
Class DataInput

java.lang.Object
  extended by net.arnx.wmf2svg.io.DataInput

public class DataInput
extends Object

Author:
Hidekatsu Izuno

Constructor Summary
DataInput(InputStream in)
          Create a DataInput class instance using by native order.
DataInput(InputStream in, ByteOrder endian)
          Create a DataInput class instance.
 
Method Summary
 void close()
           
 int getCount()
           
 int readByte()
          Reads the next one byte of this input stream as a signed 8-bit integer.
 byte[] readBytes(int n)
           
 int readInt16()
          Reads the next two bytes of this input stream as a signed 16-bit integer.
 int readInt32()
          Reads the next four bytes of this input stream as a signed 32-bit integer.
 int readUint16()
          Reads the next two bytes of this input stream as a unsigned 16-bit integer.
 long readUint32()
          Reads the next four bytes of this input stream as a unsigned 32-bit integer.
 void setCount(int count)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataInput

public DataInput(InputStream in)
Create a DataInput class instance using by native order.

Parameters:
in - the input stream that had better buffer by a BufferedInputStream.

DataInput

public DataInput(InputStream in,
                 ByteOrder endian)
Create a DataInput class instance.

Parameters:
in - the input stream that had better buffer by a BufferedInputStream.
endian - the endian of the input stream
Method Detail

readByte

public int readByte()
             throws IOException,
                    EOFException
Reads the next one byte of this input stream as a signed 8-bit integer.

Returns:
the int value as a signed 8-bit integer.
Throws:
IOException - if an I/O error occurs.
EOFException - if this stream reaches the end before reading all the bytes.

readInt16

public int readInt16()
              throws IOException,
                     EOFException
Reads the next two bytes of this input stream as a signed 16-bit integer.

Returns:
the int value as a signed 16-bit integer.
Throws:
IOException - if an I/O error occurs.
EOFException - if this stream reaches the end before reading all the bytes.

readInt32

public int readInt32()
              throws IOException,
                     EOFException
Reads the next four bytes of this input stream as a signed 32-bit integer.

Returns:
the int value as a signed 32-bit integer.
Throws:
IOException - if an I/O error occurs.
EOFException - if this stream reaches the end before reading all the bytes.

readUint16

public int readUint16()
               throws IOException,
                      EOFException
Reads the next two bytes of this input stream as a unsigned 16-bit integer.

Returns:
the int value as a unsigned 16-bit integer.
Throws:
IOException - if an I/O error occurs.
EOFException - if this stream reaches the end before reading all the bytes.

readUint32

public long readUint32()
                throws IOException,
                       EOFException
Reads the next four bytes of this input stream as a unsigned 32-bit integer.

Returns:
the long value as a unsigned 32-bit integer.
Throws:
IOException - if an I/O error occurs.
EOFException - if this stream reaches the end before reading all the bytes.

readBytes

public byte[] readBytes(int n)
                 throws IOException,
                        EOFException
Throws:
IOException
EOFException

setCount

public void setCount(int count)

getCount

public int getCount()

close

public void close()