Package com.google.common.geometry
Interface S2Coder<T>
-
- All Known Implementing Classes:
S2LaxPolygonShape.Coder,S2LaxPolylineShape.Coder,S2Point.Shape.Coder,S2ShapeIndexCoder,S2TaggedShapeCoder,VectorCoder
@GwtCompatible public interface S2Coder<T>An interface for encoding and decoding values.This is one of several helper classes that allow complex data structures to be initialized from an encoded format in constant time and then decoded on demand. This can be a big performance advantage when only a small part of the data structure is actually used.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tdecode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor)voidencode(T value, OutputStream output)Encodesvaluetooutput.
-
-
-
Method Detail
-
encode
void encode(T value, OutputStream output) throws IOException
Encodesvaluetooutput.- Throws:
IOException
-
decode
T decode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor)
Decodes a value of typeS2Coderfromdatastarting atcursor.position.cursor.positionis updated to the position of the first byte indatafollowing the encoded value.
-
-