public void getContent(ByteBuffer paramByteBuffer) { IsoTypeWriter.writeUInt16(paramByteBuffer, this.itemId); if (ItemLocationBox.this.getVersion() == 1) IsoTypeWriter.writeUInt16(paramByteBuffer, this.constructionMethod); IsoTypeWriter.writeUInt16(paramByteBuffer, this.dataReferenceIndex); if (ItemLocationBox.this.baseOffsetSize > 0) IsoTypeWriterVariable.write( this.baseOffset, paramByteBuffer, ItemLocationBox.this.baseOffsetSize); IsoTypeWriter.writeUInt16(paramByteBuffer, this.extents.size()); Iterator localIterator = this.extents.iterator(); while (localIterator.hasNext()) ((ItemLocationBox.Extent) localIterator.next()).getContent(paramByteBuffer); }
@Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); if (getVersion() == 1) { IsoTypeWriter.writeUInt64(byteBuffer, creationTime); IsoTypeWriter.writeUInt64(byteBuffer, modificationTime); IsoTypeWriter.writeUInt32(byteBuffer, timescale); IsoTypeWriter.writeUInt64(byteBuffer, duration); } else { IsoTypeWriter.writeUInt32(byteBuffer, creationTime); IsoTypeWriter.writeUInt32(byteBuffer, modificationTime); IsoTypeWriter.writeUInt32(byteBuffer, timescale); IsoTypeWriter.writeUInt32(byteBuffer, duration); } IsoTypeWriter.writeFixedPoint1616(byteBuffer, rate); IsoTypeWriter.writeFixedPoint88(byteBuffer, volume); IsoTypeWriter.writeUInt16(byteBuffer, 0); IsoTypeWriter.writeUInt32(byteBuffer, 0); IsoTypeWriter.writeUInt32(byteBuffer, 0); for (int i = 0; i < 9; i++) { IsoTypeWriter.writeUInt32(byteBuffer, matrix[i]); } byteBuffer.putInt(previewTime); byteBuffer.putInt(previewDuration); byteBuffer.putInt(posterTime); byteBuffer.putInt(selectionTime); byteBuffer.putInt(selectionDuration); byteBuffer.putInt(currentTime); IsoTypeWriter.writeUInt32(byteBuffer, nextTrackId); }
@Override public void getBox(WritableByteChannel writableByteChannel) throws IOException { writableByteChannel.write(getHeader()); ByteBuffer byteBuffer = ByteBuffer.allocate(52 + (fontName != null ? fontName.length() : 0)); byteBuffer.position(6); IsoTypeWriter.writeUInt16(byteBuffer, dataReferenceIndex); byteBuffer.putInt(displayFlags); byteBuffer.putInt(textJustification); IsoTypeWriter.writeUInt16(byteBuffer, backgroundR); IsoTypeWriter.writeUInt16(byteBuffer, backgroundG); IsoTypeWriter.writeUInt16(byteBuffer, backgroundB); IsoTypeWriter.writeUInt64(byteBuffer, defaultTextBox); IsoTypeWriter.writeUInt64(byteBuffer, reserved1); byteBuffer.putShort(fontNumber); byteBuffer.putShort(fontFace); byteBuffer.put(reserved2); byteBuffer.putShort(reserved3); IsoTypeWriter.writeUInt16(byteBuffer, foregroundR); IsoTypeWriter.writeUInt16(byteBuffer, foregroundG); IsoTypeWriter.writeUInt16(byteBuffer, foregroundB); if (fontName != null) { IsoTypeWriter.writeUInt8(byteBuffer, fontName.length()); byteBuffer.put(fontName.getBytes()); } writableByteChannel.write((ByteBuffer) byteBuffer.rewind()); // writeContainer(writableByteChannel); there are no child boxes!? }
@Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); IsoTypeWriter.writeUInt32(byteBuffer, entries.size()); for (SampleEntry sampleEntry : entries) { IsoTypeWriter.writeUInt32(byteBuffer, sampleEntry.getSampleDelta()); IsoTypeWriter.writeUInt16(byteBuffer, sampleEntry.getSubsampleCount()); List<SampleEntry.SubsampleEntry> subsampleEntries = sampleEntry.getSubsampleEntries(); for (SampleEntry.SubsampleEntry subsampleEntry : subsampleEntries) { if (getVersion() == 1) { IsoTypeWriter.writeUInt32(byteBuffer, subsampleEntry.getSubsampleSize()); } else { IsoTypeWriter.writeUInt16(byteBuffer, l2i(subsampleEntry.getSubsampleSize())); } IsoTypeWriter.writeUInt8(byteBuffer, subsampleEntry.getSubsamplePriority()); IsoTypeWriter.writeUInt8(byteBuffer, subsampleEntry.getDiscardable()); IsoTypeWriter.writeUInt32(byteBuffer, subsampleEntry.getReserved()); } } }
@Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); IsoTypeWriter.writeUInt32(byteBuffer, maxSamplePerFrame); IsoTypeWriter.writeUInt8(byteBuffer, unknown1); IsoTypeWriter.writeUInt8(byteBuffer, sampleSize); IsoTypeWriter.writeUInt8(byteBuffer, historyMult); IsoTypeWriter.writeUInt8(byteBuffer, initialHistory); IsoTypeWriter.writeUInt8(byteBuffer, kModifier); IsoTypeWriter.writeUInt8(byteBuffer, channels); IsoTypeWriter.writeUInt16(byteBuffer, unknown2); IsoTypeWriter.writeUInt32(byteBuffer, maxCodedFrameSize); IsoTypeWriter.writeUInt32(byteBuffer, bitRate); IsoTypeWriter.writeUInt32(byteBuffer, sampleRate); }
protected void getContent(ByteBuffer paramByteBuffer) { writeVersionAndFlags(paramByteBuffer); IsoTypeWriter.writeUInt8(paramByteBuffer, this.offsetSize << 4 | this.lengthSize); if (getVersion() == 1) IsoTypeWriter.writeUInt8(paramByteBuffer, this.baseOffsetSize << 4 | this.indexSize); while (true) { IsoTypeWriter.writeUInt16(paramByteBuffer, this.items.size()); Iterator localIterator = this.items.iterator(); while (true) { if (!localIterator.hasNext()) return; ((Item) localIterator.next()).getContent(paramByteBuffer); } IsoTypeWriter.writeUInt8(paramByteBuffer, this.baseOffsetSize << 4); } }