IoBuffer newBuff = IoBuffer.allocate(buffer.remaining() - count);
for (int i = 0; i < pos; i++)
newBuff.put(buffer.get());
buffer.skip(count); // hole
while (newBuff.remaining() > 0)
newBuff.put(buffer.get());
newBuff.flip();
// copy the new buffer in the old one
buffer.rewind();
buffer.put(newBuff);