Package com.automation_pros.odva.endian
Class EndianInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.automation_pros.odva.endian.EndianInputStream
-
- All Implemented Interfaces:
EndianDataInput,java.io.Closeable,java.io.DataInput,java.lang.AutoCloseable
public class EndianInputStream extends java.io.InputStream implements EndianDataInput
-
-
Constructor Summary
Constructors Constructor Description EndianInputStream(java.io.InputStream in)EndianInputStream(java.io.InputStream in, int skip)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EndianInputStreamasLimitedInput(long limit)Returns an instance that reads from the current data source up to the number of bytes specified.intavailable()protected voidcheckReadSkip(int n)voidclose()voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] dst)intread(byte[] dst, int offset, int length)booleanreadBoolean()bytereadByte()charreadChar()charreadCharLE()Little-endian alternative to readChar()doublereadDouble()doublereadDoubleLE()Little-endian alternative to readDouble()floatreadFloat()floatreadFloatLE()Little-endian alternative to readFloat()voidreadFully(byte[] dst)voidreadFully(byte[] dst, int offset, int length)intreadInt()intreadIntLE()Little-endian alternative to readInt()java.lang.StringreadLine()longreadLong()longreadLongLE()Little-endian alternative to readLong()shortreadShort()shortreadShortLE()Little-endian alternative to readShort()intreadUnsignedByte()longreadUnsignedInt()Extension to the DataInput interface similar to readUnsignedShort(), but delivering an unsigned integer in a long.longreadUnsignedIntLE()Little-endian alternative to readUnsignedInt()java.math.BigIntegerreadUnsignedLong()Extension to the DataInput interface similar to readUnsignedShort(), but delivering an unsigned long in a bignum.java.math.BigIntegerreadUnsignedLongLE()Little-endian alternative to readUnsignedLong()intreadUnsignedShort()intreadUnsignedShortLE()Little-endian alternative to readUnsignedShort()java.lang.StringreadUTF()voidreset()longskip(long n)intskipBytes(int n)
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] dst) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] dst, int offset, int length) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
mark
public void mark(int readlimit)
- Overrides:
markin classjava.io.InputStream
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.InputStream- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.InputStream
-
readFully
public void readFully(byte[] dst) throws java.io.IOException- Specified by:
readFullyin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] dst, int offset, int length) throws java.io.IOException- Specified by:
readFullyin interfacejava.io.DataInput- Throws:
java.io.IOException
-
skipBytes
public int skipBytes(int n) throws java.io.IOException- Specified by:
skipBytesin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readBoolean
public boolean readBoolean() throws java.io.IOException- Specified by:
readBooleanin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readByte
public byte readByte() throws java.io.IOException- Specified by:
readBytein interfacejava.io.DataInput- Throws:
java.io.IOException
-
readUnsignedByte
public int readUnsignedByte() throws java.io.IOException- Specified by:
readUnsignedBytein interfacejava.io.DataInput- Throws:
java.io.IOException
-
checkReadSkip
protected void checkReadSkip(int n) throws java.io.IOException- Throws:
java.io.IOException
-
readShort
public short readShort() throws java.io.IOException- Specified by:
readShortin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readUnsignedShort
public int readUnsignedShort() throws java.io.IOException- Specified by:
readUnsignedShortin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readChar
public char readChar() throws java.io.IOException- Specified by:
readCharin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOException- Specified by:
readIntin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOException- Specified by:
readLongin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readFloat
public float readFloat() throws java.io.IOException- Specified by:
readFloatin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readDouble
public double readDouble() throws java.io.IOException- Specified by:
readDoublein interfacejava.io.DataInput- Throws:
java.io.IOException
-
readLine
public java.lang.String readLine() throws java.io.IOException- Specified by:
readLinein interfacejava.io.DataInput- Throws:
java.io.IOException
-
readUTF
public java.lang.String readUTF() throws java.io.IOException- Specified by:
readUTFin interfacejava.io.DataInput- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
readShortLE
public short readShortLE() throws java.io.IOExceptionDescription copied from interface:EndianDataInputLittle-endian alternative to readShort()- Specified by:
readShortLEin interfaceEndianDataInput- Returns:
- Throws:
java.io.IOException
-
readCharLE
public char readCharLE() throws java.io.IOExceptionDescription copied from interface:EndianDataInputLittle-endian alternative to readChar()- Specified by:
readCharLEin interfaceEndianDataInput- Returns:
- Throws:
java.io.IOException
-
readDoubleLE
public double readDoubleLE() throws java.io.IOExceptionDescription copied from interface:EndianDataInputLittle-endian alternative to readDouble()- Specified by:
readDoubleLEin interfaceEndianDataInput- Returns:
- Throws:
java.io.IOException
-
readFloatLE
public float readFloatLE() throws java.io.IOExceptionDescription copied from interface:EndianDataInputLittle-endian alternative to readFloat()- Specified by:
readFloatLEin interfaceEndianDataInput- Returns:
- Throws:
java.io.IOException
-
readIntLE
public int readIntLE() throws java.io.IOExceptionDescription copied from interface:EndianDataInputLittle-endian alternative to readInt()- Specified by:
readIntLEin interfaceEndianDataInput- Returns:
- Throws:
java.io.IOException
-
readLongLE
public long readLongLE() throws java.io.IOExceptionDescription copied from interface:EndianDataInputLittle-endian alternative to readLong()- Specified by:
readLongLEin interfaceEndianDataInput- Returns:
- Throws:
java.io.IOException
-
readUnsignedShortLE
public int readUnsignedShortLE() throws java.io.IOExceptionDescription copied from interface:EndianDataInputLittle-endian alternative to readUnsignedShort()- Specified by:
readUnsignedShortLEin interfaceEndianDataInput- Returns:
- Throws:
java.io.IOException
-
readUnsignedInt
public long readUnsignedInt() throws java.io.IOExceptionDescription copied from interface:EndianDataInputExtension to the DataInput interface similar to readUnsignedShort(), but delivering an unsigned integer in a long.- Specified by:
readUnsignedIntin interfaceEndianDataInput- Returns:
- Throws:
java.io.IOException
-
readUnsignedIntLE
public long readUnsignedIntLE() throws java.io.IOExceptionDescription copied from interface:EndianDataInputLittle-endian alternative to readUnsignedInt()- Specified by:
readUnsignedIntLEin interfaceEndianDataInput- Returns:
- Throws:
java.io.IOException
-
readUnsignedLong
public java.math.BigInteger readUnsignedLong() throws java.io.IOExceptionDescription copied from interface:EndianDataInputExtension to the DataInput interface similar to readUnsignedShort(), but delivering an unsigned long in a bignum.- Specified by:
readUnsignedLongin interfaceEndianDataInput- Returns:
- Throws:
java.io.IOException
-
readUnsignedLongLE
public java.math.BigInteger readUnsignedLongLE() throws java.io.IOExceptionDescription copied from interface:EndianDataInputLittle-endian alternative to readUnsignedLong()- Specified by:
readUnsignedLongLEin interfaceEndianDataInput- Returns:
- Throws:
java.io.IOException
-
asLimitedInput
public EndianInputStream asLimitedInput(long limit)
Description copied from interface:EndianDataInputReturns an instance that reads from the current data source up to the number of bytes specified.- Specified by:
asLimitedInputin interfaceEndianDataInput- Parameters:
limit- Number of bytes to read from this subordinate source before signalling end of file. Underlying implementations may truncate this to 32 bits.- Returns:
-
-