@Test public void testSerializationNull() { Envelope bounds = new Envelope(); int[] serializedForm = Float32BoundsSerializer.serialize(bounds); Envelope bounds2 = Float32BoundsSerializer.deserialize(serializedForm); assertEquals(bounds, bounds2); } }
private static Envelope readBounds(DataInput in) throws IOException { // directly use the default encoding int[] serializedForm = new int[] { readSignedVarInt(in), readSignedVarInt(in), readSignedVarInt(in), readSignedVarInt(in) }; return Float32BoundsSerializer.deserialize(serializedForm); }
/** * This assumes that envelope is on the float32 grid (should be the case with Bounded objects) * * @param envelope * @param data * @throws IOException */ private static void writeBounds(Envelope envelope, DataOutput data) throws IOException { // directly use the default encoding int[] serializedForm = Float32BoundsSerializer.serialize(envelope); writeSignedVarInt(serializedForm[0], data); writeSignedVarInt(serializedForm[1], data); writeSignedVarInt(serializedForm[2], data); writeSignedVarInt(serializedForm[3], data); }
private static Envelope readBounds(DataInput in) throws IOException { //directly use the default encoding int[] serializedForm = new int[] { readSignedVarInt(in),readSignedVarInt(in),readSignedVarInt(in),readSignedVarInt(in)}; return Float32BoundsSerializer.deserialize(serializedForm); }
/** * This assumes that envelope is on the float32 grid (should be the case with Bounded objects) * @param envelope * @param data * @throws IOException */ private static void writeBounds(Envelope envelope, DataOutput data) throws IOException { //directly use the default encoding int[] serializedForm = Float32BoundsSerializer.serialize(envelope); writeSignedVarInt(serializedForm[0],data); writeSignedVarInt(serializedForm[1],data); writeSignedVarInt(serializedForm[2],data); writeSignedVarInt(serializedForm[3],data); }
@Test public void testSerializationNull() { Envelope bounds = new Envelope(); int[] serializedForm = Float32BoundsSerializer.serialize(bounds); Envelope bounds2 = Float32BoundsSerializer.deserialize(serializedForm); assertEquals(bounds, bounds2); } }
@Test public void testSerialization() { Envelope bounds = new Envelope(1, 2, 3, 4); int[] serializedForm = Float32BoundsSerializer.serialize(bounds); Envelope bounds2 = Float32BoundsSerializer.deserialize(serializedForm); assertEquals(bounds, bounds2); }
@Test public void testSerialization() { Envelope bounds = new Envelope(1, 2, 3, 4); int[] serializedForm = Float32BoundsSerializer.serialize(bounds); Envelope bounds2 = Float32BoundsSerializer.deserialize(serializedForm); assertEquals(bounds, bounds2); }