### Question:
BitBuffer { public void seek(int pos) { this.pos = pos; } BitBuffer(long bits); void write(BitBuffer bits); int position(); void seek(int pos); long readBit(); void writeBit(long x); void writeGolombRice(int shift, long value); void writeGolombRiceFast(int shift, long value); void writeEliasDelta(long value); long readEliasDelta(); long readNumber(int bitCount); long readNumber(long pos, int bitCount); static long foldSigned(long x); static long unfoldSigned(long x); int readUntilZero(int pos); void writeNumber(long x, int bitCount); void skipGolombRice(int shift); int skipGolombRice(int pos, int shift); void clear(); static int getEliasDeltaSize(long value); final long[] data; }### Answer:
@Test public void testSeek() { BitBufferDirect buff = new BitBufferDirect(8000); for (int i = 0; i < 100; i++) { buff.seek(10 * i); buff.writeNumber(i, 8); } buff = new BitBufferDirect(buff.toByteArray()); for (int i = 0; i < 100; i++) { buff.seek(10 * i); assertEquals(i, buff.readNumber(8)); } }