static byte[] adaptArray(byte[] ftdiData)
    {
        int length = ftdiData.length;
        if(length > 64)
        {
            int n = 1;
            int p = 64;
            // Precalculate length without FTDI headers
            while(p < length)
            {
                n++;
                p = n*64;
            }
            int realLength = length - n*2;
            byte[] data = new byte[realLength];
            copyData(ftdiData, data);
            return data;
        }
        else if (length == 2) // special case optimization that returns the same instance.
        {
            return EMPTY_BYTE_ARRAY;
        }
        else
        {
            return Arrays.copyOfRange(ftdiData, 2, length);
        }
    }
@Test
    public void withHeaders() {
        byte[] withHeaders = {1, 2, 3, 4, 5, 6};
        byte[] wanted = {3,4,5,6};
        Assert.assertArrayEquals(wanted, FTDISerialDevice.adaptArray(withHeaders));
    }