public void initContainer(ReadableByteChannel readableByteChannel, long containerSize, BoxParser boxParser) throws IOException { long contentProcessed = 0; while (containerSize < 0 || contentProcessed < containerSize) { try { ParsableBox b = boxParser.parseBox(readableByteChannel, (this instanceof ParsableBox) ? ((ParsableBox) this).getType() : null); boxes.add(b); contentProcessed += b.getSize(); } catch (EOFException e) { if (containerSize < 0) { return; } else { throw e; } } } }
public void initContainer(ReadableByteChannel readableByteChannel, long containerSize, BoxParser boxParser) throws IOException { long contentProcessed = 0; while (containerSize < 0 || contentProcessed < containerSize) { try { ParsableBox b = boxParser.parseBox(readableByteChannel, (this instanceof ParsableBox) ? ((ParsableBox) this).getType() : null); boxes.add(b); contentProcessed += b.getSize(); } catch (EOFException e) { if (containerSize < 0) { return; } else { throw e; } } } }