public void setBodySize(int length) { size = length + headerSize(); }
public long getBodySize() { return size - headerSize(); }
public long getBodySize() { return size - headerSize(); }
public void setBodySize(int length) { size = length + headerSize(); }
public long getBodySize() { return size - headerSize(); }
public void setBodySize(int length) { size = length + headerSize(); }
public byte[] readContents(InputStream di) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); for (int i = 0; i < size - headerSize(); i++) { baos.write(di.read()); } return baos.toByteArray(); }
public byte[] readContents(InputStream di) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); for (int i = 0; i < size - headerSize(); i++) { baos.write(di.read()); } return baos.toByteArray(); }
public byte[] readContents(InputStream di) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); for (int i = 0; i < size - headerSize(); i++) { baos.write(di.read()); } return baos.toByteArray(); }
public void skip(InputStream di) throws IOException { StringReader.sureSkip(di, size - headerSize()); }
public void skip(InputStream di) throws IOException { StringReader.sureSkip(di, size - headerSize()); }
public void skip(InputStream di) throws IOException { StringReader.sureSkip(di, size - headerSize()); }
public void write(ByteBuffer buf) { ByteBuffer dup = buf.duplicate(); NIOUtils.skip(buf, 8); doWrite(buf); header.setBodySize(buf.position() - dup.position() - 8); Assert.assertEquals(header.headerSize(), 8); header.write(dup); }
public void write(ByteBuffer buf) { ByteBuffer dup = buf.duplicate(); NIOUtils.skip(buf, 8); doWrite(buf); header.setBodySize(buf.position() - dup.position() - 8); Assert.assertEquals(header.headerSize(), 8); header.write(dup); }
public void write(ByteBuffer buf) { ByteBuffer dup = buf.duplicate(); NIOUtils.skip(buf, 8); doWrite(buf); header.setBodySize(buf.position() - dup.position() - 8); Assert.assertEquals(header.headerSize(), 8); header.write(dup); }
public Box parseBox(SeekableByteChannel input) throws IOException { input.position(offset + header.headerSize()); return NodeBox.parseBox(NIOUtils.fetchFrom(input, (int) header.getSize()), header, BoxFactory.getDefault()); }
public Box parseBox(SeekableByteChannel input) throws IOException { input.setPosition(offset + header.headerSize()); return BoxUtil.parseBox(NIOUtils.fetchFromChannel(input, (int) header.getBodySize()), header, BoxFactory.getDefault()); }
public Box parseBox(SeekableByteChannel input) throws IOException { input.position(offset + header.headerSize()); return NodeBox.parseBox(NIOUtils.fetchFrom(input, (int) header.getSize()), header, BoxFactory.getDefault()); }
private boolean isMoov(SeekableByteChannel is, Atom atom) throws IOException { is.setPosition(atom.getOffset() + atom.getHeader().headerSize()); try { Box mov = BoxUtil.parseBox(NIOUtils.fetchFromChannel(is, (int) atom.getHeader().getSize()), Header.createHeader("moov", atom .getHeader().getSize()), BoxFactory.getDefault()); return (mov instanceof MovieBox) && BoxUtil.containsBox((NodeBox) mov, "mvhd"); } catch (Throwable t) { return false; } } }