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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
decode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor)
void
encode(T value, java.io.OutputStream output)
Encodesvalue
tooutput
.
-
-
-
Method Detail
-
encode
void encode(T value, java.io.OutputStream output) throws java.io.IOException
Encodesvalue
tooutput
.- Throws:
java.io.IOException
-
decode
T decode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor)
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.
-
-