Package org.meteoinfo.io
Class EndianDataOutputStream
- java.lang.Object
-
- org.meteoinfo.io.EndianDataOutputStream
-
public class EndianDataOutputStream extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description EndianDataOutputStream(java.io.OutputStream out)Creates new EndianDataOutputStream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()close stream*voidflush()flush stream*voidwrite(byte[] b)Write bytesvoidwrite(byte[] b, int off, int len)write bytesvoidwriteByteBE(int b)write a byte in BigEndian - this is exactly the same as the LittleEndian version since there's no endian in a single bytevoidwriteByteLE(int b)write a byte in LittleEndian - this is exactly the same as the BigEndian version since there's no endian in a single bytevoidwriteBytesBE(java.lang.String s)write a set of bytes in BigEndian - this is exactly the same as the LittleEndian version since there's no endian in a single bytevoidwriteBytesLE(java.lang.String s)write a set of bytes in LittleEndian - this is exactly the same as the BigEndian version since there's no endian in a single bytevoidwriteDoubleBE(double d)write a 64bit double in BigEndianvoidwriteDoubleLE(double d)write a 64bit double in LittleEndianvoidwriteFloatBE(float f)Write a float in big endianvoidwriteFloatLE(float f)Write a float in little endianvoidwriteIntBE(int i)write a 32bit int in BigEndianvoidwriteIntLE(int i)write a 32bit int in LittleEndianvoidwriteLongBE(long l)write a 64bit long in BigEndianvoidwriteLongLE(long l)write a 64bit long in LittleEndianvoidwriteShortBE(int s)write a 16bit short in BigEndianvoidwriteShortLE(int s)write a 16bit short in LittleEndian
-
-
-
Method Detail
-
close
public void close() throws java.io.IOExceptionclose stream*- Throws:
java.io.IOException
-
write
public void write(byte[] b) throws java.io.IOExceptionWrite bytes- Parameters:
b- bytes- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOExceptionwrite bytes- Parameters:
b-off-len-- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOExceptionflush stream*- Throws:
java.io.IOException
-
writeByteLE
public void writeByteLE(int b) throws java.io.IOExceptionwrite a byte in LittleEndian - this is exactly the same as the BigEndian version since there's no endian in a single byte- Parameters:
b-- Throws:
java.io.IOException
-
writeByteBE
public void writeByteBE(int b) throws java.io.IOExceptionwrite a byte in BigEndian - this is exactly the same as the LittleEndian version since there's no endian in a single byte- Parameters:
b-- Throws:
java.io.IOException
-
writeBytesLE
public void writeBytesLE(java.lang.String s) throws java.io.IOExceptionwrite a set of bytes in LittleEndian - this is exactly the same as the BigEndian version since there's no endian in a single byte- Parameters:
s-- Throws:
java.io.IOException
-
writeBytesBE
public void writeBytesBE(java.lang.String s) throws java.io.IOExceptionwrite a set of bytes in BigEndian - this is exactly the same as the LittleEndian version since there's no endian in a single byte- Parameters:
s-- Throws:
java.io.IOException
-
writeShortBE
public void writeShortBE(int s) throws java.io.IOExceptionwrite a 16bit short in BigEndian- Parameters:
s-- Throws:
java.io.IOException
-
writeShortLE
public void writeShortLE(int s) throws java.io.IOExceptionwrite a 16bit short in LittleEndian- Parameters:
s-- Throws:
java.io.IOException
-
writeIntBE
public void writeIntBE(int i) throws java.io.IOExceptionwrite a 32bit int in BigEndian- Parameters:
i-- Throws:
java.io.IOException
-
writeIntLE
public void writeIntLE(int i) throws java.io.IOExceptionwrite a 32bit int in LittleEndian- Parameters:
i-- Throws:
java.io.IOException
-
writeLongBE
public void writeLongBE(long l) throws java.io.IOExceptionwrite a 64bit long in BigEndian- Parameters:
l-- Throws:
java.io.IOException
-
writeLongLE
public void writeLongLE(long l) throws java.io.IOExceptionwrite a 64bit long in LittleEndian- Parameters:
l-- Throws:
java.io.IOException
-
writeFloatBE
public void writeFloatBE(float f) throws java.io.IOExceptionWrite a float in big endian- Parameters:
f- Float value- Throws:
java.io.IOException
-
writeFloatLE
public void writeFloatLE(float f) throws java.io.IOExceptionWrite a float in little endian- Parameters:
f- Float value- Throws:
java.io.IOException
-
writeDoubleBE
public void writeDoubleBE(double d) throws java.io.IOExceptionwrite a 64bit double in BigEndian- Parameters:
d-- Throws:
java.io.IOException
-
writeDoubleLE
public void writeDoubleLE(double d) throws java.io.IOExceptionwrite a 64bit double in LittleEndian- Parameters:
d-- Throws:
java.io.IOException
-
-