Package org.bimserver.client
Class CountingLittleEndianDataInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.bimserver.client.CountingLittleEndianDataInputStream
-
- All Implemented Interfaces:
Closeable,DataInput,AutoCloseable
public final class CountingLittleEndianDataInputStream extends FilterInputStream implements DataInput
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCountingLittleEndianDataInputStream(InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidalign4()voidalign8()intgetPos()booleanreadBoolean()bytereadByte()charreadChar()Reads a char as specified byDataInputStream.readChar(), except using little-endian byte order.doublereadDouble()Reads adoubleas specified byDataInputStream.readDouble(), except using little-endian byte order.floatreadFloat()Reads afloatas specified byDataInputStream.readFloat(), except using little-endian byte order.voidreadFully(byte[] b)voidreadFully(byte[] b, int off, int len)intreadInt()Reads an integer as specified byDataInputStream.readInt(), except using little-endian byte order.StringreadLine()This method will throw anUnsupportedOperationException.longreadLong()Reads alongas specified byDataInputStream.readLong(), except using little-endian byte order.shortreadShort()Reads ashortas specified byDataInputStream.readShort(), except using little-endian byte order.intreadUnsignedByte()intreadUnsignedShort()Reads an unsignedshortas specified byDataInputStream.readUnsignedShort(), except using little-endian byte order.StringreadUTF()intskipBytes(int n)-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
CountingLittleEndianDataInputStream
protected CountingLittleEndianDataInputStream(InputStream in)
-
-
Method Detail
-
align8
public void align8() throws IOException- Throws:
IOException
-
align4
public void align4() throws IOException- Throws:
IOException
-
getPos
public int getPos()
-
readLine
public String readLine()
This method will throw anUnsupportedOperationException.
-
readFully
public void readFully(byte[] b) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
skipBytes
public int skipBytes(int n) throws IOException- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
readUnsignedByte
public int readUnsignedByte() throws IOException- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readUnsignedShort
public int readUnsignedShort() throws IOExceptionReads an unsignedshortas specified byDataInputStream.readUnsignedShort(), except using little-endian byte order.- Specified by:
readUnsignedShortin interfaceDataInput- Returns:
- the next two bytes of the input stream, interpreted as an unsigned 16-bit integer in little-endian byte order
- Throws:
IOException- if an I/O error occurs
-
readInt
public int readInt() throws IOExceptionReads an integer as specified byDataInputStream.readInt(), except using little-endian byte order.- Specified by:
readIntin interfaceDataInput- Returns:
- the next four bytes of the input stream, interpreted as an
intin little-endian byte order - Throws:
IOException- if an I/O error occurs
-
readLong
public long readLong() throws IOExceptionReads alongas specified byDataInputStream.readLong(), except using little-endian byte order.- Specified by:
readLongin interfaceDataInput- Returns:
- the next eight bytes of the input stream, interpreted as a
longin little-endian byte order - Throws:
IOException- if an I/O error occurs
-
readFloat
public float readFloat() throws IOExceptionReads afloatas specified byDataInputStream.readFloat(), except using little-endian byte order.- Specified by:
readFloatin interfaceDataInput- Returns:
- the next four bytes of the input stream, interpreted as a
floatin little-endian byte order - Throws:
IOException- if an I/O error occurs
-
readDouble
public double readDouble() throws IOExceptionReads adoubleas specified byDataInputStream.readDouble(), except using little-endian byte order.- Specified by:
readDoublein interfaceDataInput- Returns:
- the next eight bytes of the input stream, interpreted as a
doublein little-endian byte order - Throws:
IOException- if an I/O error occurs
-
readUTF
public String readUTF() throws IOException
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
readShort
public short readShort() throws IOExceptionReads ashortas specified byDataInputStream.readShort(), except using little-endian byte order.- Specified by:
readShortin interfaceDataInput- Returns:
- the next two bytes of the input stream, interpreted as a
shortin little-endian byte order. - Throws:
IOException- if an I/O error occurs.
-
readChar
public char readChar() throws IOExceptionReads a char as specified byDataInputStream.readChar(), except using little-endian byte order.- Specified by:
readCharin interfaceDataInput- Returns:
- the next two bytes of the input stream, interpreted as a
charin little-endian byte order - Throws:
IOException- if an I/O error occurs
-
readByte
public byte readByte() throws IOException- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readBoolean
public boolean readBoolean() throws IOException- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
-