Package net.arnx.wmf2svg.io
Class DataInput
java.lang.Object
net.arnx.wmf2svg.io.DataInput
- Author:
- Hidekatsu Izuno
-
Constructor Summary
ConstructorsConstructorDescriptionDataInput(InputStream in) Create a DataInput class instance using by native order.DataInput(InputStream in, ByteOrder endian) Create a DataInput class instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intgetCount()intreadByte()Reads the next one byte of this input stream as a signed 8-bit integer.byte[]readBytes(int n) intReads the next two bytes of this input stream as a signed 16-bit integer.intReads the next four bytes of this input stream as a signed 32-bit integer.intReads the next two bytes of this input stream as a unsigned 16-bit integer.longReads the next four bytes of this input stream as a unsigned 32-bit integer.voidsetCount(int count)
-
Constructor Details
-
DataInput
Create a DataInput class instance using by native order.- Parameters:
in- the input stream that had better buffer by a BufferedInputStream.
-
DataInput
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 Details
-
readByte
Reads 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
Reads 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
Reads 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
Reads 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
Reads 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
- Throws:
IOExceptionEOFException
-
setCount
public void setCount(int count) -
getCount
public int getCount() -
close
public void close()
-