Package com.google.common.geometry
Class LittleEndianOutput
java.lang.Object
com.google.common.geometry.LittleEndianOutput
Simple utility for writing little endian primitives to a stream.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLittleEndianOutput
(OutputStream output) Constructs a little-endian output that writes to the given stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the underlying output stream.void
writeByte
(byte value) Writes a byte.void
writeBytes
(byte[] bytes) void
writeDouble
(double value) Writes a little-endian IEEE754 64-bit double.void
writeFloat
(float value) Writes a little-endian IEEE754 32-bit float.void
writeInt
(int value) Writes a little-endian signed integer.void
writeLong
(long value) Writes a little-endian signed long.void
writeVarint32
(int value) Writes a signed integer using variable encoding withwriteVarint64(long)
.void
writeVarint64
(long value) Writes a signed long using variable encoding withEncodedInts.writeVarint64(OutputStream, long)
.
-
Field Details
-
output
-
-
Constructor Details
-
LittleEndianOutput
Constructs a little-endian output that writes to the given stream.
-
-
Method Details
-
writeByte
Writes a byte.- Throws:
IOException
-
writeBytes
- Throws:
IOException
-
writeInt
Writes a little-endian signed integer.- Throws:
IOException
-
writeLong
Writes a little-endian signed long.- Throws:
IOException
-
writeFloat
Writes a little-endian IEEE754 32-bit float.- Throws:
IOException
-
writeDouble
Writes a little-endian IEEE754 64-bit double.- Throws:
IOException
-
writeVarint32
Writes a signed integer using variable encoding withwriteVarint64(long)
.- Throws:
IOException
- if past end of input or error in underlying stream
-
writeVarint64
Writes a signed long using variable encoding withEncodedInts.writeVarint64(OutputStream, long)
.- Throws:
IOException
- if past end of input or error in underlying stream
-
close
Closes the underlying output stream.- Throws:
IOException
-