public synchronized byte[] getLeadingOutOfBandData() {
        byte[] outOfBandData = null;

        if (hasLeadingOutOfBandData()) {
            outOfBandData = new byte[startOfBlockIndex == -1 ? availableByteCount : startOfBlockIndex];
            System.arraycopy(buffer, 0, outOfBandData, 0, outOfBandData.length);
        }

        return outOfBandData;
    }
@Test
    public void testGetLeadingOutOfBandData() throws Exception {
        assertNull(instance.getLeadingOutOfBandData(), "Unexpected initial value");

        instance.write(buildTestBytes(true, true, true));
        assertNull(instance.getLeadingOutOfBandData());

        instance.write("BLAH".getBytes());
        assertNull(instance.getLeadingOutOfBandData());

        instance.reset();
        assertNull(instance.getLeadingOutOfBandData());

        byte[] expected = "BLAH".getBytes();
        instance.write(expected);
        instance.write(buildTestBytes(true, true, true));
        assertArrayEquals(expected, instance.getLeadingOutOfBandData());
    }