public static void readLongArrayDeltaEncoded(DataInput in, long[] values, int offset, int length) throws IOException { long prev = 0; final int max = offset + length; for (int i = offset; i < max; i++) { long delta = readSignedVarLong(in); long value = prev + delta; values[i] = value; prev = value; } }
public static void readLongArrayDeltaEncoded(DataInput in, long[] values, int offset, int length) throws IOException { long prev = 0; final int max = offset + length; for (int i = offset; i < max; i++) { long delta = readSignedVarLong(in); long value = prev + delta; values[i] = value; prev = value; } }
@Override public UUID readUUID(DataInput in) throws IOException { long upper = readSignedVarLong(in); long lower = readSignedVarLong(in); return new java.util.UUID(upper, lower); }
@Override public UUID readUUID(DataInput in) throws IOException { long upper = readSignedVarLong(in); long lower = readSignedVarLong(in); return new java.util.UUID(upper, lower); }
@Override public Long readLong(DataInput in) throws IOException { return Long.valueOf(readSignedVarLong(in)); }
@Override public Long readLong(DataInput in) throws IOException { return Long.valueOf(readSignedVarLong(in)); }
public static long[] readSignedLongArray(DataInput in) throws IOException { final int length = readLength(in); long[] values = new long[length]; for (int i = 0; i < length; i++) { values[i] = readSignedVarLong(in); } return values; }
public static long[] readLongArrayDeltaEncoded(DataInput in) throws IOException { final int length = readLength(in); long[] values = new long[length]; long prev = 0; for (int i = 0; i < length; i++) { long delta = readSignedVarLong(in); long value = prev + delta; values[i] = value; prev = value; } return values; }
public static long[] readSignedLongArray(DataInput in) throws IOException { final int length = readLength(in); long[] values = new long[length]; for (int i = 0; i < length; i++) { values[i] = readSignedVarLong(in); } return values; }
public static long[] readLongArrayDeltaEncoded(DataInput in) throws IOException { final int length = readLength(in); long[] values = new long[length]; long prev = 0; for (int i = 0; i < length; i++) { long delta = readSignedVarLong(in); long value = prev + delta; values[i] = value; prev = value; } return values; }
private static Envelope readBoundingBox(DataInput in) throws IOException { final long x1 = readSignedVarLong(in); final long y1 = readSignedVarLong(in); final long x2 = readSignedVarLong(in); final long y2 = readSignedVarLong(in); final double minx = toDoublePrecision(x1); final double maxx = toDoublePrecision(x2); final double miny = toDoublePrecision(y1); final double maxy = toDoublePrecision(y2); return new Envelope(minx, maxx, miny, maxy); }
private static Envelope readBoundingBox(DataInput in) throws IOException { final long x1 = readSignedVarLong(in); final long y1 = readSignedVarLong(in); final long x2 = readSignedVarLong(in); final long y2 = readSignedVarLong(in); final double minx = toDoublePrecision(x1); final double maxx = toDoublePrecision(x2); final double miny = toDoublePrecision(y1); final double maxy = toDoublePrecision(y2); return new Envelope(minx, maxx, miny, maxy); }
public Envelope readPointBoundingBox(DataInput in) throws IOException { final long x1 = readSignedVarLong(in); final long y1 = readSignedVarLong(in); final double x = toDoublePrecision(x1); final double y = toDoublePrecision(y1); return new Envelope(x, x, y, y); }
public Envelope readPointBoundingBox(DataInput in) throws IOException { final long x1 = readSignedVarLong(in); final long y1 = readSignedVarLong(in); final double x = toDoublePrecision(x1); final double y = toDoublePrecision(y1); return new Envelope(x, x, y, y); }
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); }