implemented the ByteBufferInputStream