@NonNull
    TagHeader readTagHeader() throws ID3ReaderException, IOException {
        expectChar('I');
        expectChar('D');
        expectChar('3');
        short version = readShort();
        byte flags = readByte();
        int size = unsynchsafe(readInt());
        if ((flags & 0b01000000) != 0) {
            int extendedHeaderSize = readInt();
            skipBytes(extendedHeaderSize - 4);
        }
        return new TagHeader("ID3", size, version, flags);
    }
@Test
    public void testReadTagHeader() throws IOException, ID3ReaderException {
        byte[] data = generateId3Header(23);
        CountingInputStream inputStream = new CountingInputStream(new ByteArrayInputStream(data));
        TagHeader header = new ID3Reader(inputStream).readTagHeader();
        assertEquals("ID3", header.getId());
        assertEquals(42, header.getVersion());
        assertEquals(23, header.getSize());
    }