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
ConstructorDescriptionCreates aTLcdDataOutputStream
wrapper around aOutputStream
allowing to write little-endian mode words to the output stream. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Returns true if the numbers written to the stream are written in little endian format.final void
setLittleEndianMode
(boolean aFlag) Specifies whether numbers written to the stream will be written in little endian format.final void
writeBIDouble
(double aDouble) Writes a big-endian double.final void
writeBIFloat
(float aDouble) Writes a big-endian float.final void
writeBIInt
(int aInt) Writes a big-endian integer.void
writeByte
(int aInt) Writes a byte to the output stream.final void
writeLIDouble
(double aDouble) Writes a little-endian double.final void
writeLIFloat
(float aDouble) Writes a little-endian float.final void
writeLIInt
(int aInt) Writes a little-endian integer.final void
writeLong
(long aLong) Writes a long in little or big endian mode depending on the value of the property littleEndianMode.
-
Constructor Details
-
TLcdDataOutputStream
Creates aTLcdDataOutputStream
wrapper around aOutputStream
allowing 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
-