public static void writeLongArrayDeltaEncoded(DataOutput out, long[] values, int offset, int length) throws IOException { long prev = 0; final int max = offset + length; for (int i = offset; i < max; i++) { long value = values[i]; long delta = value - prev; prev = value; writeSignedVarLong(delta, out); } }
public static void writeLongArrayDeltaEncoded(DataOutput out, long[] values, int offset, int length) throws IOException { long prev = 0; final int max = offset + length; for (int i = offset; i < max; i++) { long value = values[i]; long delta = value - prev; prev = value; writeSignedVarLong(delta, out); } }
@Override public void writeUUID(UUID field, DataOutput data) throws IOException { writeSignedVarLong(field.getMostSignificantBits(), data); writeSignedVarLong(field.getLeastSignificantBits(), data); }
@Override public void writeUUID(UUID field, DataOutput data) throws IOException { writeSignedVarLong(field.getMostSignificantBits(), data); writeSignedVarLong(field.getLeastSignificantBits(), data); }
@Override public void writeLong(Long field, DataOutput data) throws IOException { writeSignedVarLong(field.longValue(), data); }
@Override public void writeLong(Long field, DataOutput data) throws IOException { writeSignedVarLong(field.longValue(), data); }
public static void writeLongArrayDeltaEncoded(long[] values, DataOutput out) throws IOException { final int length = writeLength(values, out); long prev = 0; for (int i = 0; i < length; i++) { long value = values[i]; long delta = value - prev; prev = value; writeSignedVarLong(delta, out); } }
public static void writeSignedLongArray(long[] values, DataOutput out) throws IOException { final int length = writeLength(values, out); for (int i = 0; i < length; i++) { writeSignedVarLong(values[i], out); } }
private static void writeBoundingBox(double minx, double maxx, double miny, double maxy, DataOutput data) throws IOException { long x1 = toFixedPrecision(minx, RoundingMode.HALF_DOWN); long y1 = toFixedPrecision(miny, RoundingMode.HALF_DOWN); long x2 = toFixedPrecision(maxx, RoundingMode.HALF_UP); long y2 = toFixedPrecision(maxy, RoundingMode.HALF_UP); writeSignedVarLong(x1, data); writeSignedVarLong(y1, data); writeSignedVarLong(x2, data); writeSignedVarLong(y2, data); }
public void writePointBoundingBox(double x, double y, DataOutput data) throws IOException { long x1 = toFixedPrecision(x); long y1 = toFixedPrecision(y); writeSignedVarLong(x1, data); writeSignedVarLong(y1, data); }
private static void writeBoundingBox(double minx, double maxx, double miny, double maxy, DataOutput data) throws IOException { long x1 = toFixedPrecision(minx, RoundingMode.HALF_DOWN); long y1 = toFixedPrecision(miny, RoundingMode.HALF_DOWN); long x2 = toFixedPrecision(maxx, RoundingMode.HALF_UP); long y2 = toFixedPrecision(maxy, RoundingMode.HALF_UP); writeSignedVarLong(x1, data); writeSignedVarLong(y1, data); writeSignedVarLong(x2, data); writeSignedVarLong(y2, data); }
public static void writeLongArrayDeltaEncoded(long[] values, DataOutput out) throws IOException { final int length = writeLength(values, out); long prev = 0; for (int i = 0; i < length; i++) { long value = values[i]; long delta = value - prev; prev = value; writeSignedVarLong(delta, out); } }
public static void writeSignedLongArray(long[] values, DataOutput out) throws IOException { final int length = writeLength(values, out); for (int i = 0; i < length; i++) { writeSignedVarLong(values[i], out); } }
public void writePointBoundingBox(double x, double y, DataOutput data) throws IOException { long x1 = toFixedPrecision(x); long y1 = toFixedPrecision(y); writeSignedVarLong(x1, data); writeSignedVarLong(y1, data); }
private void checkSignedVarLong(final long value) throws IOException { ByteArrayDataOutput out = newDataOutput(); writeSignedVarLong(value, out); long read = readSignedVarLong(newDataInput(out.toByteArray())); assertEquals(value, read); }
private void checkSignedVarLong(final long value) throws IOException { ByteArrayDataOutput out = newDataOutput(); writeSignedVarLong(value, out); long read = readSignedVarLong(newDataInput(out.toByteArray())); assertEquals(value, read); }