protected String readEncodingAndString(int max) throws IOException {
        byte encoding = readByte();
        return readEncodedString(encoding, max - 1);
    }
@Test
    public void testReadUtf16RespectsBom() throws IOException {
        byte[] data = {
            ID3Reader.ENCODING_UTF16_WITH_BOM,
            (byte) 0xff, (byte) 0xfe, // BOM: Little-endian
            'A', 0, 'B', 0, 'C', 0,
            0, 0, // Null-terminated
            ID3Reader.ENCODING_UTF16_WITH_BOM,
            (byte) 0xfe, (byte) 0xff, // BOM: Big-endian
            0, 'D', 0, 'E', 0, 'F',
            0, 0, // Null-terminated
        };
        CountingInputStream inputStream = new CountingInputStream(new ByteArrayInputStream(data));
        ID3Reader reader = new ID3Reader(inputStream);
        assertEquals("ABC", reader.readEncodingAndString(1000));
        assertEquals("DEF", reader.readEncodingAndString(1000));
    }