public static void writeUInt32BE(ByteBuffer bb, long u) { assert u >= 0 && u <= 1L << 32 : "The given long is not in the range of uint32 (" + u + ")"; writeUInt16BE(bb, (int) u & 0xFFFF); writeUInt16BE(bb, (int) ((u >> 16) & 0xFFFF)); }
@Override public ByteBuffer getData() { int size = 4 + 2; for (PlayReadyRecord record : records) { size += 2 + 2; size += record.getValue().rewind().limit(); } ByteBuffer byteBuffer = ByteBuffer.allocate(size); IsoTypeWriter.writeUInt32BE(byteBuffer, size); IsoTypeWriter.writeUInt16BE(byteBuffer, records.size()); for (PlayReadyRecord record : records) { IsoTypeWriter.writeUInt16BE(byteBuffer, record.type); IsoTypeWriter.writeUInt16BE(byteBuffer, record.getValue().limit()); ByteBuffer tmp4debug = record.getValue(); byteBuffer.put(tmp4debug); } return byteBuffer; }
public static void writeUInt32BE(ByteBuffer bb, long u) { assert u >= 0 && u <= 1L << 32 : "The given long is not in the range of uint32 (" + u + ")"; writeUInt16BE(bb, (int) u & 0xFFFF); writeUInt16BE(bb, (int) ((u >> 16) & 0xFFFF)); }
@Override public ByteBuffer getData() { int size = 4 + 2; for (PlayReadyRecord record : records) { size += 2 + 2; size += record.getValue().rewind().limit(); } ByteBuffer byteBuffer = ByteBuffer.allocate(size); IsoTypeWriter.writeUInt32BE(byteBuffer, size); IsoTypeWriter.writeUInt16BE(byteBuffer, records.size()); for (PlayReadyRecord record : records) { IsoTypeWriter.writeUInt16BE(byteBuffer, record.type); IsoTypeWriter.writeUInt16BE(byteBuffer, record.getValue().limit()); ByteBuffer tmp4debug = record.getValue(); byteBuffer.put(tmp4debug); } return byteBuffer; }