Search in sources :

Example 6 with FrameHeader

use of de.danoeh.antennapod.parser.media.id3.model.FrameHeader in project AntennaPod by AntennaPod.

the class Id3ReaderTest method testReadFrameHeader.

@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());
}
Also used : FrameHeader(de.danoeh.antennapod.parser.media.id3.model.FrameHeader) ByteArrayInputStream(java.io.ByteArrayInputStream) CountingInputStream(org.apache.commons.io.input.CountingInputStream) Test(org.junit.Test)

Aggregations

FrameHeader (de.danoeh.antennapod.parser.media.id3.model.FrameHeader)6 ByteArrayInputStream (java.io.ByteArrayInputStream)4 CountingInputStream (org.apache.commons.io.input.CountingInputStream)4 Test (org.junit.Test)4 Chapter (de.danoeh.antennapod.model.feed.Chapter)3