Package com.google.common.geometry
Class LittleEndianInput
java.lang.Object
com.google.common.geometry.LittleEndianInput
Simple utility for reading little endian primitives from a stream.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLittleEndianInput
(InputStream input) Constructs a little-endian input that reads from the given stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the underlying stream.byte
readByte()
Reads a byte.byte[]
readBytes
(int size) Reads a fixed size of bytes from the input.double
Reads a little-endian IEEE754 64-bit double.float
Reads a little-endian IEEE754 32-bit float.int
readInt()
Reads a little-endian signed integer.long
readLong()
Reads a little-endian signed long.int
Reads a variable-encoded signed integer withreadVarint64()
.long
Reads a variable-encoded signed long withEncodedInts.readVarint64(InputStream)
-
Field Details
-
input
-
-
Constructor Details
-
LittleEndianInput
Constructs a little-endian input that reads from the given stream.
-
-
Method Details
-
readByte
Reads a byte.- Throws:
IOException
- ifinput.read()
throws anIOException
or returns -1 (EOF).
-
readBytes
Reads a fixed size of bytes from the input.- Parameters:
size
- the number of bytes to read.- Throws:
IOException
- if past end of input or error in underlying stream
-
readInt
Reads a little-endian signed integer.- Throws:
IOException
- if past end of input or error in underlying stream
-
readLong
Reads a little-endian signed long.- Throws:
IOException
- if past end of input or error in underlying stream
-
readFloat
Reads a little-endian IEEE754 32-bit float.- Throws:
IOException
- if past end of input or error in underlying stream
-
readDouble
Reads a little-endian IEEE754 64-bit double.- Throws:
IOException
- if past end of input or error in underlying stream
-
readVarint32
Reads a variable-encoded signed integer withreadVarint64()
.- Throws:
IOException
- if past end of input or error in underlying stream
-
readVarint64
Reads a variable-encoded signed long withEncodedInts.readVarint64(InputStream)
- Throws:
IOException
- if past end of input or error in underlying stream
-
close
Closes the underlying stream.- Throws:
IOException
-