Class EndianDataOutputStream
java.lang.Object
com.vividsolutions.jump.io.EndianDataOutputStream
- All Implemented Interfaces:
AutoCloseable
A class that gives most of the functionality of DataOutputStream, but is endian aware.
Uses a real java.io.DataOutputStream to actually do the writing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()close streamvoidflush()flush streamvoidwrite(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 bytevoidwrite a set of bytes in BigEndian - this is exactly the same as the LittleEndian version since there's no endian in a single bytevoidwrite 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 LittleEndianvoidwriteIntBE(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
-
Constructor Details
-
EndianDataOutputStream
Creates new EndianDataOutputStream
-
-
Method Details
-
close
close stream- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
write
-
flush
-
writeByteLE
write a byte in LittleEndian - this is exactly the same as the BigEndian version since there's no endian in a single byte- Throws:
IOException
-
writeByteBE
write a byte in BigEndian - this is exactly the same as the LittleEndian version since there's no endian in a single byte- Throws:
IOException
-
writeBytesLE
write a set of bytes in LittleEndian - this is exactly the same as the BigEndian version since there's no endian in a single byte- Throws:
IOException
-
writeBytesBE
write a set of bytes in BigEndian - this is exactly the same as the LittleEndian version since there's no endian in a single byte- Throws:
IOException
-
writeShortBE
write a 16bit short in BigEndian- Throws:
IOException
-
writeShortLE
write a 16bit short in LittleEndian- Throws:
IOException
-
writeIntBE
-
writeIntLE
write a 32bit int in LittleEndian- Throws:
IOException
-
writeLongBE
write a 64bit long in BigEndian- Throws:
IOException
-
writeLongLE
write a 64bit long in LittleEndian- Throws:
IOException
-
writeDoubleBE
write a 64bit double in BigEndian- Throws:
IOException
-
writeDoubleLE
write a 64bit double in LittleEndian- Throws:
IOException
-