### Question:
DataOutputBuffer extends DataOutputStream { public DataOutputBuffer reset() { this.written = 0; buffer.reset(); return this; } DataOutputBuffer();  DataOutputBuffer(int size); private  DataOutputBuffer(Buffer buffer); byte[] getData(); int getLength(); DataOutputBuffer reset(); void write(DataInput in, int length); void writeTo(OutputStream out);  }### Answer:
@Test public void testGetPosition() throws Exception { DataInputBuffer inputBuffer = new DataInputBuffer(); inputBuffer.reset(tests, 0, tests.length); final int position = 2; int n = position; while (n-- > 0) { inputBuffer.readByte(); } assertEquals(inputBuffer.getPosition(), position); inputBuffer.close(); }