use of de.danoeh.antennapod.parser.media.id3.model.TagHeader in project AntennaPod by AntennaPod.
the class ID3Reader method readInputStream.
public void readInputStream() throws IOException, ID3ReaderException {
tagHeader = readTagHeader();
int tagContentStartPosition = getPosition();
while (getPosition() < tagContentStartPosition + tagHeader.getSize()) {
FrameHeader frameHeader = readFrameHeader();
if (frameHeader.getId().charAt(0) < '0' || frameHeader.getId().charAt(0) > 'z') {
Log.d(TAG, "Stopping because of invalid frame: " + frameHeader.toString());
return;
}
readFrame(frameHeader);
}
}
use of de.danoeh.antennapod.parser.media.id3.model.TagHeader in project AntennaPod by AntennaPod.
the class Id3ReaderTest method testReadTagHeader.
@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());
}
Aggregations