Package org.locationtech.jts.jump.io
Class EndianDataOutputStream
- java.lang.Object
-
- org.locationtech.jts.jump.io.EndianDataOutputStream
-
public class EndianDataOutputStream extends Object
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 Constructor Description EndianDataOutputStream(OutputStream out)Creates new EndianDataOutputStream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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 bytevoidwriteBytesBE(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(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 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 Detail
-
EndianDataOutputStream
public EndianDataOutputStream(OutputStream out)
Creates new EndianDataOutputStream
-
-
Method Detail
-
close
public void close() throws IOExceptionclose stream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOExceptionwrite bytes- Throws:
IOException
-
flush
public void flush() throws IOExceptionflush stream- Throws:
IOException
-
writeByteLE
public void writeByteLE(int b) throws IOExceptionwrite 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
public void writeByteBE(int b) throws IOExceptionwrite 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
public void writeBytesLE(String s) throws IOException
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
public void writeBytesBE(String s) throws IOException
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
public void writeShortBE(int s) throws IOExceptionwrite a 16bit short in BigEndian- Throws:
IOException
-
writeShortLE
public void writeShortLE(int s) throws IOExceptionwrite a 16bit short in LittleEndian- Throws:
IOException
-
writeIntBE
public void writeIntBE(int i) throws IOExceptionwrite a 32bit int in BigEndian- Throws:
IOException
-
writeIntLE
public void writeIntLE(int i) throws IOExceptionwrite a 32bit int in LittleEndian- Throws:
IOException
-
writeLongBE
public void writeLongBE(long l) throws IOExceptionwrite a 64bit long in BigEndian- Throws:
IOException
-
writeLongLE
public void writeLongLE(long l) throws IOExceptionwrite a 64bit long in LittleEndian- Throws:
IOException
-
writeDoubleBE
public void writeDoubleBE(double d) throws IOExceptionwrite a 64bit double in BigEndian- Throws:
IOException
-
writeDoubleLE
public void writeDoubleLE(double d) throws IOExceptionwrite a 64bit double in LittleEndian- Throws:
IOException
-
-