@NonNull
    FrameHeader readFrameHeader() throws IOException {
        String id = readPlainBytesToString(FRAME_ID_LENGTH);
        int size = readInt();
        if (tagHeader != null && tagHeader.getVersion() >= 0x0400) {
            size = unsynchsafe(size);
        }
        short flags = readShort();
        return new FrameHeader(id, size, flags);
    }
@Test
    public void testReadFrameHeader() throws IOException {
        byte[] data = generateFrameHeader("CHAP", 42);
        CountingInputStream inputStream = new CountingInputStream(new ByteArrayInputStream(data));
        FrameHeader header = new ID3Reader(inputStream).readFrameHeader();
        assertEquals("CHAP", header.getId());
        assertEquals(42, header.getSize());
    }