Package net.arnx.wmf2svg.io
Class DataInput
- java.lang.Object
-
- net.arnx.wmf2svg.io.DataInput
-
public class DataInput extends Object
- Author:
- Hidekatsu Izuno
-
-
Constructor Summary
Constructors Constructor Description DataInput(InputStream in)Create a DataInput class instance using by native order.DataInput(InputStream in, ByteOrder endian)Create a DataInput class instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()intgetCount()intreadByte()Reads the next one byte of this input stream as a signed 8-bit integer.byte[]readBytes(int n)intreadInt16()Reads the next two bytes of this input stream as a signed 16-bit integer.intreadInt32()Reads the next four bytes of this input stream as a signed 32-bit integer.intreadUint16()Reads the next two bytes of this input stream as a unsigned 16-bit integer.longreadUint32()Reads the next four bytes of this input stream as a unsigned 32-bit integer.voidsetCount(int count)
-
-
-
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, EOFExceptionReads the next one byte of this input stream as a signed 8-bit integer.- Returns:
- the
intvalue 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, EOFExceptionReads the next two bytes of this input stream as a signed 16-bit integer.- Returns:
- the
intvalue 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, EOFExceptionReads the next four bytes of this input stream as a signed 32-bit integer.- Returns:
- the
intvalue 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, EOFExceptionReads the next two bytes of this input stream as a unsigned 16-bit integer.- Returns:
- the
intvalue 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, EOFExceptionReads the next four bytes of this input stream as a unsigned 32-bit integer.- Returns:
- the
longvalue 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:
IOExceptionEOFException
-
setCount
public void setCount(int count)
-
getCount
public int getCount()
-
close
public void close()
-
-