Package org.meteoinfo.io
Class EndianDataInputStream
- java.lang.Object
-
- org.meteoinfo.io.EndianDataInputStream
-
public class EndianDataInputStream extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description EndianDataInputStream(java.io.InputStream in)Creates new EndianDataInputStream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()close the streabytereadByteBE()read a byte in BigEndian - the same as LE because its only 1 bytbytereadByteLE()read a byte in LittleEndian - the same as BE because its only 1 bytvoidreadByteLEnum(byte[] b)read a byte in LittleEndian - the same as BE because its only 1 bytedoublereadDoubleBE()read a 64bit double in BEdoublereadDoubleLE()read a 64bit double in LEintreadIntBE()read a 32bit int in BEintreadIntLE()read a 32bit int in LElongreadLongBE()read a 64bit long in BElongreadLongLE()read a 64bit long in LEshortreadShortBE()read a 16bit short in BEshortreadShortLE()read a 16bit short in LEintreadUnsignedByteBE()read a byte in BigEndian - the same as LE because its only 1 byte.intreadUnsignedByteLE()read a byte in LittleEndian - the same as BE because its only 1 byte.intskipBytes(int num)skip ahead in the stream
-
-
-
Method Detail
-
close
public void close() throws java.io.IOExceptionclose the strea- Throws:
java.io.IOException
-
readByteBE
public byte readByteBE() throws java.io.IOExceptionread a byte in BigEndian - the same as LE because its only 1 byt- Throws:
java.io.IOException
-
readByteLE
public byte readByteLE() throws java.io.IOExceptionread a byte in LittleEndian - the same as BE because its only 1 byt- Throws:
java.io.IOException
-
readByteLEnum
public void readByteLEnum(byte[] b) throws java.io.IOExceptionread a byte in LittleEndian - the same as BE because its only 1 byte- Throws:
java.io.IOException
-
readUnsignedByteBE
public int readUnsignedByteBE() throws java.io.IOExceptionread a byte in BigEndian - the same as LE because its only 1 byte. returns int as per java.io.DataStream- Throws:
java.io.IOException
-
readUnsignedByteLE
public int readUnsignedByteLE() throws java.io.IOExceptionread a byte in LittleEndian - the same as BE because its only 1 byte. returns int as per java.io.DataStream- Throws:
java.io.IOException
-
readShortBE
public short readShortBE() throws java.io.IOExceptionread a 16bit short in BE- Throws:
java.io.IOException
-
readShortLE
public short readShortLE() throws java.io.IOExceptionread a 16bit short in LE- Throws:
java.io.IOException
-
readIntBE
public int readIntBE() throws java.io.IOExceptionread a 32bit int in BE- Throws:
java.io.IOException
-
readIntLE
public int readIntLE() throws java.io.IOExceptionread a 32bit int in LE- Throws:
java.io.IOException
-
readLongBE
public long readLongBE() throws java.io.IOExceptionread a 64bit long in BE- Throws:
java.io.IOException
-
readLongLE
public long readLongLE() throws java.io.IOExceptionread a 64bit long in LE- Throws:
java.io.IOException
-
readDoubleBE
public double readDoubleBE() throws java.io.IOExceptionread a 64bit double in BE- Throws:
java.io.IOException
-
readDoubleLE
public double readDoubleLE() throws java.io.IOExceptionread a 64bit double in LE- Throws:
java.io.IOException
-
skipBytes
public int skipBytes(int num) throws java.io.IOExceptionskip ahead in the stream- Parameters:
num- number of bytes to read ahead- Throws:
java.io.IOException
-
-