### Question:
LinkedBufferInput extends AbstractInput { public byte readByte() throws EOFException { ByteBuffer bb = null; try { bb = link.getFirst(); } catch(NoSuchElementException e) {} if (bb == null || bb.remaining() == 0) { throw new EndOfBufferException(); } byte result = bb.get(); incrReadOneByteCount(); if (bb.remaining() == 0) { removeFirstLink(bb); } return result; } LinkedBufferInput(int bufferSize); int read(byte[] b, int off, int len); boolean tryRefer(BufferReferer ref, int len); byte readByte(); void advance(); byte getByte(); short getShort(); int getInt(); long getLong(); float getFloat(); double getDouble(); void feed(byte[] b); void feed(byte[] b, boolean reference); void feed(byte[] b, int off, int len); void feed(byte[] b, int off, int len, boolean reference); void feed(ByteBuffer b); void feed(ByteBuffer buf, boolean reference); void clear(); void copyReferencedBuffer(); int getSize(); void close();  }### Answer:
@Test public void testReadByte() throws IOException { byte[] src = new byte[8]; src[0] = (byte)1; src[2] = (byte)1; src[4] = (byte)1; ByteArrayInputStream bin = new ByteArrayInputStream(src); DataInputStream b1 = new DataInputStream(bin); LinkedBufferInput b2 = new LinkedBufferInput(8); b2.feed(src); for(int i=0; i < src.length; i++) { assertEquals(b1.readByte(), b2.readByte()); } assertEndOfBuffer(b2); }