byte[] src = "HELLO MINA".getBytes();
byte[] dst = new byte[src.length];
ByteBuffer bb = ByteBuffer.wrap(src);
InputStream is = new ByteBufferInputStream(bb);
assertEquals(true, is.markSupported());
is.mark(src.length);
assertEquals(dst.length, is.read(dst));
assertArrayEquals(src, dst);
assertEquals(-1, is.read());
is.close();