@@ -0,0 +1,665 @@
+package de.jungblut.datastructure;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.nio.ByteBuffer;%0A%0Apublic final class ByteBufferInputStream extends InputStream %7B%0A%0A  private final ByteBuffer buf;%0A%0A  public ByteBufferInputStream(ByteBuffer buf) %7B%0A    this.buf = buf;%0A  %7D%0A%0A  @Override%0A  public int read() throws IOException %7B%0A    if (!buf.hasRemaining()) %7B%0A      return -1;%0A    %7D%0A    return buf.get() & 0xFF;%0A  %7D%0A%0A  @Override%0A  public int read(byte%5B%5D bytes, int off, int len) throws IOException %7B%0A    if (!buf.hasRemaining()) %7B%0A      return -1;%0A    %7D%0A%0A    len = Math.min(len, buf.remaining());%0A    buf.get(bytes, off, len);%0A    return len;%0A  %7D%0A%7D%0A

add a byte buffer input stream