Package com.google.common.geometry
Interface S2Coder<T>
- All Known Implementing Classes:
S2CellIdVectorCoder,S2LaxPolygonShape.Coder,S2LaxPolylineShape.Coder,S2Point.Shape.Coder,S2PointVectorCoder,S2ShapeIndexCoder,S2TaggedShapeCoder,UintVectorCoder,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
Modifier and TypeMethodDescriptiondecode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor) voidencode(T value, OutputStream output) Encodesvaluetooutput.
-
Method Details
-
encode
Encodesvaluetooutput.- Throws:
IOException
-
decode
Decodes a value of typeS2Coderfromdatastarting atcursor.position.cursor.positionis updated to the position of the first byte indatafollowing the encoded value.
-