Package com.luciad.io
Class TLcdDataOutputStream
java.lang.Object
com.luciad.io.TLcdDataOutputStream
This class is similar to a DataOutputStream, except that it can also write
little-endian binary data instead of only big-endian data.
The position is incremented before the write operations, so it will be incremented even if the operation fails.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aTLcdDataOutputStreamwrapper around aOutputStreamallowing to write little-endian mode words to the output stream. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanReturns true if the numbers written to the stream are written in little endian format.final voidsetLittleEndianMode(boolean aFlag) Specifies whether numbers written to the stream will be written in little endian format.final voidwriteBIDouble(double aDouble) Writes a big-endian double.final voidwriteBIFloat(float aDouble) Writes a big-endian float.final voidwriteBIInt(int aInt) Writes a big-endian integer.voidwriteByte(int aInt) Writes a byte to the output stream.final voidwriteLIDouble(double aDouble) Writes a little-endian double.final voidwriteLIFloat(float aDouble) Writes a little-endian float.final voidwriteLIInt(int aInt) Writes a little-endian integer.final voidwriteLong(long aLong) Writes a long in little or big endian mode depending on the value of the property littleEndianMode.
-
Constructor Details
-
TLcdDataOutputStream
Creates aTLcdDataOutputStreamwrapper around aOutputStreamallowing to write little-endian mode words to the output stream.- Parameters:
out- the output stream to wrap.
-
-
Method Details
-
writeBIInt
Writes a big-endian integer.- Parameters:
aInt- the integer to write.- Throws:
IOException- if an I/O error occurs.
-
writeLIInt
Writes a little-endian integer.- Parameters:
aInt- the integer to write.- Throws:
IOException- if an I/O error occurs.
-
writeLong
Writes a long in little or big endian mode depending on the value of the property littleEndianMode.- Parameters:
aLong- the long to write.- Throws:
IOException- if an I/O error occurs.
-
writeLIFloat
Writes a little-endian float.- Parameters:
aDouble- the float to write.- Throws:
IOException- if an I/O error occurs.- Since:
- 2017.1
-
writeBIFloat
Writes a big-endian float.- Parameters:
aDouble- the float to write.- Throws:
IOException- if an I/O error occurs.- Since:
- 2017.1
-
writeLIDouble
Writes a little-endian double.- Parameters:
aDouble- the double to write.- Throws:
IOException- if an I/O error occurs.
-
writeBIDouble
Writes a big-endian double.- Parameters:
aDouble- the double to write.- Throws:
IOException- if an I/O error occurs.
-
writeByte
Writes a byte to the output stream.- Parameters:
aInt- the byte to write.- Throws:
IOException- if an I/O error occurs.
-
setLittleEndianMode
public final void setLittleEndianMode(boolean aFlag) Specifies whether numbers written to the stream will be written in little endian format. In little endian format, the data stream stores the least significant byte first (lowest address) and the most significant byte last (highest address). The default istrue.- Parameters:
aFlag- true when numbers written to the stream will be written in little endian format.- Since:
- 2018.0
-
isLittleEndianMode
public final boolean isLittleEndianMode()Returns true if the numbers written to the stream are written in little endian format. In little endian format, the data stream stores the least significant byte first (lowest address) and the most significant byte last (highest address).- Returns:
- true if the numbers written to the stream are written in little endian format.
- Since:
- 2018.0
-