decoderOutput.message = null;
decoderOutput.reset();
    private void doSplitMessageTest(int splitOffset, String data) throws ProtocolViolationException {        String firstChunk = data.substring(0, splitOffset);        String remaining = data.substring(splitOffset);        buffer.put(firstChunk.getBytes());        buffer.flip();        decoderOutput.message = null;        if (splitOffset < 12) {            assertEquals("shouldn't recognize header; offset=" + splitOffset,                    MessageDecoderResult.NEED_DATA, decoder.decodable(null, buffer));        } else {            // Bug #127 - Resolved.            //Since the message will be recognized after the first 12 bytes then the            //message can be processed after the first 12 bytes.  This means that if            //A partial buffer comes in with 12,13,14 bytes (depending on size), extraction             //of the message will fail.            //This type of Exception will only occur during heavy loads of incoming messages,            //which may cause the buffers to come in as partial messages.            //            //The ByteBuffer.hasRemaining() will fail, because the buffer always has remaining            //if you don't move it's internal positioning.            assertEquals("should recognize header", MessageDecoderResult.OK, decoder.decodable(                    null, buffer));            if (splitOffset < data.length()) {                assertEquals("shouldn't decode message; offset=" + splitOffset,                        MessageDecoderResult.NEED_DATA, decoder.decode(null, buffer, decoderOutput));                assertNull("shouldn't write message; offset=" + splitOffset, decoderOutput.message);                buffer.compact();                buffer.put(remaining.getBytes());                buffer.flip();                assertMessageFound(data);            } else {                assertEquals("should parse message; offset=" + splitOffset,                        MessageDecoderResult.OK, decoder.decode(null, buffer, decoderOutput));                assertNotNull("should write message; offset=" + splitOffset, decoderOutput.message);            }        }        buffer.clear();    }