### Question:
DataBuffer implements DataInput, DataOutput { public void reset(byte[] bytes, int offset, int length) { this.buffer = bytes; reset(offset, length); } DataBuffer();  DataBuffer(int initialCapacity);  DataBuffer(int initialCapacity, double expansionFactor); void reset(byte[] bytes, int offset, int length); void reset(int offset, int length); byte[] getData(); int getReadPosition(); int getReadLimit(); int getWritePosition(); int getReadRemaining(); void ensureCapacity(int newSize); int read(); @Override boolean readBoolean(); @Override byte readByte(); @Override int readUnsignedByte(); @Override short readShort(); @Override int readUnsignedShort(); @Override char readChar(); @Override int readInt(); @Override long readLong(); @Override float readFloat(); @Override double readDouble(); @Override void readFully(byte[] b); @Override void readFully(byte[] b, int off, int len); @Override int skipBytes(int n); @Override String readLine(); @Override String readUTF(); @Override void write(int b); @Override void write(byte[] b); @Override void write(byte[] b, int off, int len); @Override void writeBoolean(boolean v); @Override void writeByte(int v); @Override void writeShort(int v); @Override void writeChar(int v); @Override void writeInt(int v); @Override void writeLong(long v); @Override void writeFloat(float v); @Override void writeDouble(double v); @Override void writeBytes(String s); @Override void writeChars(String s); @Override void writeUTF(String s); void write(DataInput in, int len); @Override String toString();  }### Answer:
@Test public void reset() throws Exception { DataBuffer buffer = new DataBuffer(); byte[] b1 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; buffer.reset(b1, 0, b1.length); assertThat(buffer.getReadPosition(), is(0)); assertThat(buffer.getReadRemaining(), is(10)); buffer.reset(1, 8); assertThat(buffer.getReadPosition(), is(1)); assertThat(buffer.getReadRemaining(), is(8)); }