public class BinaryCodec extends Object
| Modifier and Type | Field and Description |
|---|---|
protected SpatialContext |
ctx |
protected static byte |
TYPE_CIRCLE |
protected static byte |
TYPE_COLL |
protected static byte |
TYPE_GEOM |
protected static byte |
TYPE_POINT |
protected static byte |
TYPE_RECT |
| Constructor and Description |
|---|
BinaryCodec(SpatialContext ctx,
SpatialContextFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
Circle |
readCircle(DataInput dataInput) |
ShapeCollection |
readCollection(DataInput dataInput) |
protected double |
readDim(DataInput dataInput) |
Point |
readPoint(DataInput dataInput) |
Rectangle |
readRect(DataInput dataInput) |
Shape |
readShape(DataInput dataInput) |
protected Shape |
readShapeByTypeIfSupported(DataInput dataInput,
byte type) |
protected byte |
typeForShape(Shape s) |
void |
writeCircle(DataOutput dataOutput,
Circle c) |
void |
writeCollection(DataOutput dataOutput,
ShapeCollection col) |
protected void |
writeDim(DataOutput dataOutput,
double v) |
void |
writePoint(DataOutput dataOutput,
Point pt) |
void |
writeRect(DataOutput dataOutput,
Rectangle r) |
void |
writeShape(DataOutput dataOutput,
Shape s) |
protected boolean |
writeShapeByTypeIfSupported(DataOutput dataOutput,
Shape s)
Note: writes the type byte even if not supported
|
protected boolean |
writeShapeByTypeIfSupported(DataOutput dataOutput,
Shape s,
byte type) |
protected static final byte TYPE_POINT
protected static final byte TYPE_RECT
protected static final byte TYPE_CIRCLE
protected static final byte TYPE_COLL
protected static final byte TYPE_GEOM
protected final SpatialContext ctx
public BinaryCodec(SpatialContext ctx, SpatialContextFactory factory)
public Shape readShape(DataInput dataInput) throws IOException
IOExceptionpublic void writeShape(DataOutput dataOutput, Shape s) throws IOException
IOExceptionprotected Shape readShapeByTypeIfSupported(DataInput dataInput, byte type) throws IOException
IOExceptionprotected boolean writeShapeByTypeIfSupported(DataOutput dataOutput, Shape s) throws IOException
IOExceptionprotected boolean writeShapeByTypeIfSupported(DataOutput dataOutput, Shape s, byte type) throws IOException
IOExceptionprotected byte typeForShape(Shape s)
protected double readDim(DataInput dataInput) throws IOException
IOExceptionprotected void writeDim(DataOutput dataOutput, double v) throws IOException
IOExceptionpublic Point readPoint(DataInput dataInput) throws IOException
IOExceptionpublic void writePoint(DataOutput dataOutput, Point pt) throws IOException
IOExceptionpublic Rectangle readRect(DataInput dataInput) throws IOException
IOExceptionpublic void writeRect(DataOutput dataOutput, Rectangle r) throws IOException
IOExceptionpublic Circle readCircle(DataInput dataInput) throws IOException
IOExceptionpublic void writeCircle(DataOutput dataOutput, Circle c) throws IOException
IOExceptionpublic ShapeCollection readCollection(DataInput dataInput) throws IOException
IOExceptionpublic void writeCollection(DataOutput dataOutput, ShapeCollection col) throws IOException
IOExceptionCopyright © 2025. All rights reserved.