public void write(byte[] bytes) { ensureBufferSize(bytes.length * SizeOf.UBYTE); this.data.put(bytes); if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
public void writeShort(short i) { ensureBufferSize(SizeOf.USHORT); data.putShort(i); if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
@Override public void writeByte(int b) { ensureBufferSize(SizeOf.UBYTE); data.put((byte) b); if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
public void writeInt(int i) { ensureBufferSize(SizeOf.UINT); this.data.putInt(i); if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
public void write(short[] shorts) { ensureBufferSize(shorts.length * SizeOf.USHORT); for (short s : shorts) { writeShort(s); } if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
/** * Writes 0x00 until the position is aligned to a multiple of 4. */ public void alignToFourBytesWithZeroFill() { int alignedPos = SizeOf.roundToTimesOfFour(data.position()); ensureBufferSize((alignedPos - data.position()) * SizeOf.UBYTE); while ((data.position() & 3) != 0) { data.put((byte) 0); } if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
public void skipWithAutoExpand(int count) { ensureBufferSize(SizeOf.UBYTE * count); skip(count); }
public void writeShort(short i) { ensureBufferSize(SizeOf.USHORT); data.putShort(i); if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
@Override public void writeByte(int b) { ensureBufferSize(SizeOf.UBYTE); data.put((byte) b); if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
public void writeInt(int i) { ensureBufferSize(SizeOf.UINT); this.data.putInt(i); if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
public void write(byte[] bytes) { ensureBufferSize(bytes.length * SizeOf.UBYTE); this.data.put(bytes); if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
public void write(short[] shorts) { ensureBufferSize(shorts.length * SizeOf.USHORT); for (short s : shorts) { writeShort(s); } if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
/** * Writes 0x00 until the position is aligned to a multiple of 4. */ public void alignToFourBytesWithZeroFill() { int alignedPos = SizeOf.roundToTimesOfFour(data.position()); ensureBufferSize((alignedPos - data.position()) * SizeOf.UBYTE); while ((data.position() & 3) != 0) { data.put((byte) 0); } if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
public void skipWithAutoExpand(int count) { ensureBufferSize(SizeOf.UBYTE * count); skip(count); }