@Test public void testPackInt() throws Exception { DataOutput2 out = new DataOutput2(); DataInput2 in = new DataInput2(ByteBuffer.wrap(out.buf,0, out.pos),0); for(int i = 0;i>-1; i = i + 1 + i/1111){ out.pos = 0; Utils.packInt(out, i); in.pos = 0; in.buf.clear(); int i2 = Utils.unpackInt(in); Assert.assertEquals(i, i2); } }
static public void packInt(DataOutput in, int value) throws IOException { if (value < 0) { throw new IllegalArgumentException("negative value: keys=" + value); } while ((value & ~0x7F) != 0) { in.write(((value & 0x7F) | 0x80)); value >>>= 7; } in.write((byte) value); }
Utils { static public void packInt(DataOutput in, int value) throws IOException { if (value < 0) { throw new IllegalArgumentException("negative value: keys=" + value); } while ((value & ~0x7F) != 0) { in.write(((value & 0x7F) | 0x80)); value >>>= 7; } in.write((byte) value); } }
Utils { static public void packInt(DataOutput in, int value) throws IOException { if (value < 0) { throw new IllegalArgumentException("negative value: keys=" + value); } while ((value & ~0x7F) != 0) { in.write(((value & 0x7F) | 0x80)); value >>>= 7; } in.write((byte) value); }  }
Utils { static public void packInt(DataOutput in, int value) throws IOException { if (value < 0) { throw new IllegalArgumentException("negative value: keys=" + value); } while ((value & ~0x7F) != 0) { in.write(((value & 0x7F) | 0x80)); value >>>= 7; } in.write((byte) value); }  static void packLong(DataOutput out, long value); static long unpackLong(DataInput in); static void packInt(DataOutput in, int value); static int unpackInt(DataInput is); static int longHash(final long key); static E clone(E value, Serializer<E> serializer); static Object[] arrayPut(final Object[] array, final int pos, final Object value); static long[] arrayLongPut(final long[] array, final int pos, final long value); static int nextPowTwo(final int value); static File tempDbFile(); static boolean isWindows(); static boolean isAndroid(); static boolean JVMSupportsLargeMappedFiles(); static void checkMapValueIsNotCollecion(Object value); static void printProgress(final AtomicLong value); static DataOutput2 serializer(Serializer<A> serializer, A value); }
Utils { static public void packInt(DataOutput in, int value) throws IOException { if (value < 0) { throw new IllegalArgumentException("negative value: keys=" + value); } while ((value & ~0x7F) != 0) { in.write(((value & 0x7F) | 0x80)); value >>>= 7; } in.write((byte) value); }  static void packLong(DataOutput out, long value); static long unpackLong(DataInput in); static void packInt(DataOutput in, int value); static int unpackInt(DataInput is); static int longHash(final long key); static E clone(E value, Serializer<E> serializer); static Object[] arrayPut(final Object[] array, final int pos, final Object value); static long[] arrayLongPut(final long[] array, final int pos, final long value); static int nextPowTwo(final int value); static File tempDbFile(); static boolean isWindows(); static boolean isAndroid(); static boolean JVMSupportsLargeMappedFiles(); static void checkMapValueIsNotCollecion(Object value); static void printProgress(final AtomicLong value); static DataOutput2 serializer(Serializer<A> serializer, A value); @SuppressWarnings("rawtypes")
	static final Comparator<Comparable> COMPARABLE_COMPARATOR; @SuppressWarnings("rawtypes")
	static final Comparator<Comparable> COMPARABLE_COMPARATOR_WITH_NULLS; static final String EMPTY_STRING; static final String UTF8; static Random RANDOM; }