int nextHeader = indexOf(buffer, messageStartPosition + 1, headerBytes);
int newOffset = bodyStartPosition + bodyLength; int nextHeader = indexOf(buffer, newOffset, headerBytes);
    private void handleError(ByteBuffer buffer, String text, boolean disconnect)            throws MessageParseException {        int nextHeader = indexOf(buffer, messageStartPosition + 1, headerBytes);        if (nextHeader != -1) {            buffer.position(nextHeader);        } else {            buffer.position(buffer.limit());        }        position = 0;        state = SEEKING_HEADER;        // TODO log in session log, if possible        log.error(text);        if (disconnect) {            throw new MessageParseException(text + " (during logon)");        }    }