class NIO::ByteBuffer
def compact
Move data between the position and limit to the beginning of the buffer
def compact @buffer[0...(@limit - @position)] = @buffer[@position...@limit] @position = @limit - @position @limit = capacity self end
def compact @buffer[0...(@limit - @position)] = @buffer[@position...@limit] @position = @limit - @position @limit = capacity self end