final void padBytes(byte padByte, int length) { ensureLength(offset_ + length); for (int i = 0; i < length; i++) { bytes_[offset_++] = padByte; } }
protected final void writeScalar1Byte(int codePoint, int value) { ensureLength(offset_ + 5); bytes_[offset_++] = 0x00; bytes_[offset_++] = 0x05; bytes_[offset_++] = (byte) ((codePoint >>> 8) & 0xff); bytes_[offset_++] = (byte) (codePoint & 0xff); bytes_[offset_++] = (byte) (value & 0xff); }
final void padBytes(byte padByte, int length) { ensureLength(offset_ + length); for (int i = 0; i < length; i++) { bytes_[offset_++] = padByte; } }
final void write2Bytes(int value) { ensureLength(offset_ + 2); bytes_[offset_++] = (byte) ((value >>> 8) & 0xff); bytes_[offset_++] = (byte) (value & 0xff); }
final void buildTripletHeader(int tripletLength, int tripletType, int tripletId) { ensureLength(offset_ + 3); bytes_[offset_++] = (byte) (tripletLength & 0xff); bytes_[offset_++] = (byte) (tripletType & 0xff); bytes_[offset_++] = (byte) (tripletId & 0xff); }
final void writeScalarBytes(int codePoint, byte[] buf, int length) { ensureLength(offset_ + length + 4); bytes_[offset_++] = (byte) (((length + 4) >>> 8) & 0xff); bytes_[offset_++] = (byte) ((length + 4) & 0xff); bytes_[offset_++] = (byte) ((codePoint >>> 8) & 0xff); bytes_[offset_++] = (byte) (codePoint & 0xff); for (int i = 0; i < length; i++) { bytes_[offset_++] = buf[i]; } }
protected final void writeScalar1Byte(int codePoint, int value) { ensureLength(offset_ + 5); bytes_[offset_++] = 0x00; bytes_[offset_++] = 0x05; bytes_[offset_++] = (byte) ((codePoint >>> 8) & 0xff); bytes_[offset_++] = (byte) (codePoint & 0xff); bytes_[offset_++] = (byte) (value & 0xff); }
final void writeScalarBytes(int codePoint, byte[] buff) { int buffLength = buff.length; ensureLength(offset_ + buffLength + 4); bytes_[offset_++] = (byte) (((buffLength + 4) >>> 8) & 0xff); bytes_[offset_++] = (byte) ((buffLength + 4) & 0xff); bytes_[offset_++] = (byte) ((codePoint >>> 8) & 0xff); bytes_[offset_++] = (byte) (codePoint & 0xff); System.arraycopy(buff, 0, bytes_, offset_, buffLength); offset_ += buffLength; }
final void writeBytes(byte[] buf) { ensureLength(offset_ + buf.length); System.arraycopy(buf, 0, bytes_, offset_, buf.length); offset_ += buf.length; }
final void writeBytes(byte[] buf) { ensureLength(offset_ + buf.length); System.arraycopy(buf, 0, bytes_, offset_, buf.length); offset_ += buf.length; }
final void writeScalarBytes(int codePoint, byte[] buff, int start, int length) { ensureLength(offset_ + length + 4); bytes_[offset_++] = (byte) (((length + 4) >>> 8) & 0xff); bytes_[offset_++] = (byte) ((length + 4) & 0xff); bytes_[offset_++] = (byte) ((codePoint >>> 8) & 0xff); bytes_[offset_++] = (byte) (codePoint & 0xff); System.arraycopy(buff, start, bytes_, offset_, length); offset_ += length; }
final void writeScalarPaddedBytes(byte[] buff, int paddedLength, byte padByte) { int buffLength = buff.length; ensureLength(offset_ + paddedLength); System.arraycopy(buff, 0, bytes_, offset_, buffLength); offset_ += buffLength; for (int i = 0; i < paddedLength - buffLength; i++) { bytes_[offset_++] = padByte; } }
protected final void markLengthBytes(int codePoint) { ensureLength(offset_ + 4); // save the location of length bytes in the mark stack. mark(); // skip the length bytes and insert the codepoint offset_ += 2; bytes_[offset_++] = (byte) ((codePoint >>> 8) & 0xff); bytes_[offset_++] = (byte) (codePoint & 0xff); }
protected void writeShortFdocaData(short v) { ensureLength(offset_ + 2); com.pivotal.gemfirexd.internal.client.am.SignedBinary.shortToBigEndianBytes(bytes_, offset_, v); offset_ += 2; }
protected void writeLongFdocaData(long v) { ensureLength(offset_ + 8); com.pivotal.gemfirexd.internal.client.am.SignedBinary.longToBigEndianBytes(bytes_, offset_, v); offset_ += 8; }
protected void writeDouble(double v) { ensureLength(offset_ + 8); com.pivotal.gemfirexd.internal.client.am.FloatingPoint.doubleToIeee754Bytes(bytes_, offset_, v); offset_ += 8; }
protected final void markLengthBytes(int codePoint) { ensureLength(offset_ + 4); // save the location of length bytes in the mark stack. mark(); // skip the length bytes and insert the codepoint offset_ += 2; bytes_[offset_++] = (byte) ((codePoint >>> 8) & 0xff); bytes_[offset_++] = (byte) (codePoint & 0xff); }
void writeInt(int v) { ensureLength(offset_ + 4); com.pivotal.gemfirexd.internal.client.am.SignedBinary.intToBigEndianBytes(bytes_, offset_, v); offset_ += 4; }
final void writeScalarString(int codePoint, String string) throws SqlException { int stringLength = string.length(); ensureLength(offset_ + stringLength + 4); bytes_[offset_++] = (byte) (((stringLength + 4) >>> 8) & 0xff); bytes_[offset_++] = (byte) ((stringLength + 4) & 0xff); bytes_[offset_++] = (byte) ((codePoint >>> 8) & 0xff); bytes_[offset_++] = (byte) (codePoint & 0xff); offset_ = ccsidManager_.convertFromUCS2(string, bytes_, offset_, netAgent_); }
final void writeScalarPaddedString(int codePoint, String string, int paddedLength) throws SqlException { int stringLength = string.length(); ensureLength(offset_ + paddedLength + 4); bytes_[offset_++] = (byte) (((paddedLength + 4) >>> 8) & 0xff); bytes_[offset_++] = (byte) ((paddedLength + 4) & 0xff); bytes_[offset_++] = (byte) ((codePoint >>> 8) & 0xff); bytes_[offset_++] = (byte) (codePoint & 0xff); offset_ = ccsidManager_.convertFromUCS2(string, bytes_, offset_, netAgent_); for (int i = 0; i < paddedLength - stringLength; i++) { bytes_[offset_++] = ccsidManager_.space_; } }