public override void WriteShort(short value) { if (this.position + 2 <= MAX_BLOCK_SIZE) { JavaBits.PutShort(this.buffer, this.position, value); this.position += 2; } }
public override void WriteChar(char value) { if (this.position + 2 <= MAX_BLOCK_SIZE) { JavaBits.PutChar(this.buffer, this.position, value); this.position += 2; } }
public override void WriteLong(long value) { if (this.position + 8 <= MAX_BLOCK_SIZE) { JavaBits.PutLong(this.buffer, this.position, value); this.position += 8; } }
public override void WriteInt(int value) { if (this.position + 4 <= MAX_BLOCK_SIZE) { JavaBits.PutInt(this.buffer, this.position, value); this.position += 4; } }
public override void WriteDouble(double value) { if (this.position + 8 <= MAX_BLOCK_SIZE) { JavaBits.PutDouble(this.buffer, this.position, value); this.position += 8; } }
public override void WriteBoolean(bool value) { if (this.position >= MAX_BLOCK_SIZE) { this.Drain(); } JavaBits.PutBoolean(this.buffer, this.position++, value); }
/// <summary> /// Writes block data header. /// Data block shorter than 256 bytes are prefixed with a 2-byte header; all others start with a 5-byte header. /// </summary> /// <param name="position"></param> private void WriteBlockHeader(int position) { if (position <= 0xFF) { this.hBuffer[0] = TC_BLOCKDATA; this.hBuffer[1] = (byte)position; this.Stream.Write(this.hBuffer, 0, 2); } else { this.hBuffer[0] = TC_BLOCKDATALONG; JavaBits.PutInt(this.hBuffer, 1, position); this.Stream.Write(this.hBuffer, 0, 5); } }