class NIO::ByteBuffer

def flip

Set the buffer's current position as the limit and set the position to 0
def flip
  @limit = @position
  @position = 0
  @mark = nil
  self
end