Varint.writeSignedVarLong(i, out);
Varint.writeSignedVarLong(i+1, out);
}
Varint.writeSignedVarLong(Long.MIN_VALUE, out);
Varint.writeSignedVarLong(Long.MIN_VALUE+1, out);
DataInput in = new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));
for (long i = -1L; i >= -(1L << 62); i <<= 1) {
assertEquals(i, Varint.readSignedVarLong(in));
assertEquals(i+1, Varint.readSignedVarLong(in));
}
assertEquals(Long.MIN_VALUE, Varint.readSignedVarLong(in));