if (messageString.indexOf("8=FIX", 1) >= 0) { System.out.println("FOO"); }
    private boolean parseMessage(ByteBuffer in, ProtocolDecoderOutput out)            throws ProtocolViolationException {        try {            boolean messageFound = false;            while (in.hasRemaining() && !messageFound) {                if (state == SEEKING_HEADER) {                    int headerOffset = indexOf(in, position, HEADER_PATTERN);                    if (headerOffset == -1) {                        break;                    }                    in.position(headerOffset);                    if (log.isDebugEnabled()) {                        log.debug("detected header: " + getBufferDebugInfo(in));                    }                    position = headerOffset + HEADER_PATTERN.length;                    state = PARSING_LENGTH;                }                if (state == PARSING_LENGTH) {                    byte ch = 0;                    while (hasRemaining(in)) {                        ch = get(in);                        if (!Character.isDigit((char) ch)) {                            break;                        }                        bodyLength = bodyLength * 10 + (ch - '0');                    }                    if (ch == '\001') {                        state = READING_BODY;                        if (log.isDebugEnabled()) {                            log                                    .debug("body length = " + bodyLength + ": "                                            + getBufferDebugInfo(in));                        }                    } else {                        if (hasRemaining(in)) {                            handleError(in, in.position() + 1, "Error in message length format",                                    false);                            continue;                        } else {                            break;                        }                    }                }                if (state == READING_BODY) {                    if (remaining(in) < bodyLength) {                        break;                    }                    position += bodyLength;                    state = PARSING_CHECKSUM;                    if (log.isDebugEnabled()) {                        log.debug("message body found: " + getBufferDebugInfo(in));                    }                }                if (state == PARSING_CHECKSUM) {                    if (startsWith(in, position, CHECKSUM_PATTERN)) {                        if (log.isDebugEnabled()) {                            log.debug("found checksum: " + getBufferDebugInfo(in));                        }                        position += CHECKSUM_PATTERN.length;                    } else {                        if (position + CHECKSUM_PATTERN.length < in.limit()) {                            // FEATURE allow configurable recovery position                            //int recoveryPosition = in.position() + 1;                            // Following recovery position is compatible with QuickFIX C++                            // but drops messages unnecessarily in corruption scenarios.                            int recoveryPosition = position + 1;                            handleError(in, recoveryPosition,                                    "did not find checksum field, bad length?", isLogon(in));                            continue;                        } else {                            break;                        }                    }                    String messageString = getMessageString(in);                    if (log.isDebugEnabled()) {                        log                                .debug("parsed message: " + getBufferDebugInfo(in) + " "                                        + messageString);                    }                    if (messageString.indexOf("8=FIX", 1) >= 0) {                        System.out.println("FOO");                    }                    out.write(messageString);                    state = SEEKING_HEADER;                    bodyLength = 0;                    messageFound = true;                }            }            return messageFound;        } catch (Throwable t) {            state = SEEKING_HEADER;            position = 0;            bodyLength = 0;            if (t instanceof ProtocolViolationException) {                throw (ProtocolViolationException) t;            } else {                throw new ProtocolViolationException(t);            }        }    }