private void readHeaderFromBuffer(final ByteBuffer buffer) {
    int toRead = MIN_RECV_PACKET - headerOffset;
    int available = buffer.remaining();
    toRead = Math.min(toRead, available);
    getLogger().debug("Reading %d header bytes", toRead);
    buffer.get(header, headerOffset, toRead);
    headerOffset += toRead;
  }
Read the header bytes from the incoming {@link ByteBuffer}.

@param buffer the buffer to read from.
src/main/java/net/spy/memcached/protocol/binary/OperationImpl.java