Package com.google.common.geometry
Class LittleEndianOutput
- java.lang.Object
-
- com.google.common.geometry.LittleEndianOutput
-
@GwtCompatible public final class LittleEndianOutput extends Object
Simple utility for writing little endian primitives to a stream.
-
-
Constructor Summary
Constructors Constructor Description LittleEndianOutput(OutputStream output)Constructs a little-endian output that writes to the given stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the underlying output stream.voidwriteByte(byte value)Writes a byte.voidwriteBytes(byte[] bytes)voidwriteDouble(double value)Writes a little-endian IEEE754 64-bit double.voidwriteFloat(float value)Writes a little-endian IEEE754 32-bit float.voidwriteInt(int value)Writes a little-endian signed integer.voidwriteLong(long value)Writes a little-endian signed long.voidwriteVarint32(int value)Writes a signed integer using variable encoding withwriteVarint64(long).voidwriteVarint64(long value)Writes a signed long using variable encoding withEncodedInts.writeVarint64(OutputStream, long).
-
-
-
Constructor Detail
-
LittleEndianOutput
public LittleEndianOutput(OutputStream output)
Constructs a little-endian output that writes to the given stream.
-
-
Method Detail
-
writeByte
public void writeByte(byte value) throws IOExceptionWrites a byte.- Throws:
IOException
-
writeBytes
public void writeBytes(byte[] bytes) throws IOException- Throws:
IOException
-
writeInt
public void writeInt(int value) throws IOExceptionWrites a little-endian signed integer.- Throws:
IOException
-
writeLong
public void writeLong(long value) throws IOExceptionWrites a little-endian signed long.- Throws:
IOException
-
writeFloat
public void writeFloat(float value) throws IOExceptionWrites a little-endian IEEE754 32-bit float.- Throws:
IOException
-
writeDouble
public void writeDouble(double value) throws IOExceptionWrites a little-endian IEEE754 64-bit double.- Throws:
IOException
-
writeVarint32
public void writeVarint32(int value) throws IOExceptionWrites a signed integer using variable encoding withwriteVarint64(long).- Throws:
IOException- if past end of input or error in underlying stream
-
writeVarint64
public void writeVarint64(long value) throws IOExceptionWrites a signed long using variable encoding withEncodedInts.writeVarint64(OutputStream, long).- Throws:
IOException- if past end of input or error in underlying stream
-
close
public void close() throws IOExceptionCloses the underlying output stream.- Throws:
IOException
-
-