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) void
encode
(T value, OutputStream output) Encodesvalue
tooutput
.
-
Method Details
-
encode
Encodesvalue
tooutput
.- Throws:
IOException
-
decode
Decodes a value of typeS2Coder
fromdata
starting atcursor.position
.cursor.position
is updated to the position of the first byte indata
following the encoded value.
-