@Override public void getBox(WritableByteChannel writableByteChannel) throws IOException { writableByteChannel.write(getHeader()); ByteBuffer byteBuffer = ByteBuffer.allocate(78); byteBuffer.position(6); IsoTypeWriter.writeUInt16(byteBuffer, dataReferenceIndex); IsoTypeWriter.writeUInt16(byteBuffer, 0); IsoTypeWriter.writeUInt16(byteBuffer, 0); IsoTypeWriter.writeUInt32(byteBuffer, predefined[0]); IsoTypeWriter.writeUInt32(byteBuffer, predefined[1]); IsoTypeWriter.writeUInt32(byteBuffer, predefined[2]); IsoTypeWriter.writeUInt16(byteBuffer, getWidth()); IsoTypeWriter.writeUInt16(byteBuffer, getHeight()); IsoTypeWriter.writeFixedPoint1616(byteBuffer, getHorizresolution()); IsoTypeWriter.writeFixedPoint1616(byteBuffer, getVertresolution()); IsoTypeWriter.writeUInt32(byteBuffer, 0); IsoTypeWriter.writeUInt16(byteBuffer, getFrameCount()); IsoTypeWriter.writeUInt8(byteBuffer, Utf8.utf8StringLengthInBytes(getCompressorname())); byteBuffer.put(Utf8.convert(getCompressorname())); int a = Utf8.utf8StringLengthInBytes(getCompressorname()); while (a < 31) { a++; byteBuffer.put((byte) 0); } IsoTypeWriter.writeUInt16(byteBuffer, getDepth()); IsoTypeWriter.writeUInt16(byteBuffer, 0xFFFF); writableByteChannel.write((ByteBuffer) byteBuffer.rewind()); writeContainer(writableByteChannel); }
@Override public void getBox(WritableByteChannel writableByteChannel) throws IOException { writableByteChannel.write(getHeader()); ByteBuffer byteBuffer = ByteBuffer.allocate(78); byteBuffer.position(6); IsoTypeWriter.writeUInt16(byteBuffer, dataReferenceIndex); IsoTypeWriter.writeUInt16(byteBuffer, 0); IsoTypeWriter.writeUInt16(byteBuffer, 0); IsoTypeWriter.writeUInt32(byteBuffer, predefined[0]); IsoTypeWriter.writeUInt32(byteBuffer, predefined[1]); IsoTypeWriter.writeUInt32(byteBuffer, predefined[2]); IsoTypeWriter.writeUInt16(byteBuffer, getWidth()); IsoTypeWriter.writeUInt16(byteBuffer, getHeight()); IsoTypeWriter.writeFixedPoint1616(byteBuffer, getHorizresolution()); IsoTypeWriter.writeFixedPoint1616(byteBuffer, getVertresolution()); IsoTypeWriter.writeUInt32(byteBuffer, 0); IsoTypeWriter.writeUInt16(byteBuffer, getFrameCount()); IsoTypeWriter.writeUInt8(byteBuffer, Utf8.utf8StringLengthInBytes(getCompressorname())); byteBuffer.put(Utf8.convert(getCompressorname())); int a = Utf8.utf8StringLengthInBytes(getCompressorname()); while (a < 31) { a++; byteBuffer.put((byte) 0); } IsoTypeWriter.writeUInt16(byteBuffer, getDepth()); IsoTypeWriter.writeUInt16(byteBuffer, 0xFFFF); writableByteChannel.write((ByteBuffer) byteBuffer.rewind()); writeContainer(writableByteChannel); }