示例#1
0
  public String convertToString(Object a) {

    if (a == null) {
      return null;
    }

    return StringConverter.byteArrayToHexString(((BlobData) a).getBytes());
  }
示例#2
0
  public String convertToSQLString(Object a) {

    if (a == null) {
      return "NULL";
    }

    return StringConverter.byteArrayToSQLHexString(((BinaryData) a).getBytes());
  }
示例#3
0
  protected void writeOther(JavaObjectData o) {

    ensureRoom(o.getBytesLength() * 2 + 2);
    write('\'');
    StringConverter.writeHexBytes(getBuffer(), count, o.getBytes());

    count += o.getBytesLength() * 2;

    write('\'');
  }
示例#4
0
  protected void writeBinary(BinaryData o) {

    ensureRoom((int) (o.length(null) * 2 + 2));
    write('\'');
    StringConverter.writeHexBytes(getBuffer(), count, o.getBytes());

    count += (o.length(null) * 2);

    write('\'');
  }
示例#5
0
  protected void writeBit(BinaryData o) {

    ensureRoom((int) (o.length(null) * 8 + 2));
    write('\'');

    String s = StringConverter.byteArrayToBitString(o.getBytes(), (int) o.bitLength(null));

    writeBytes(s);
    write('\'');
  }
示例#6
0
  protected void writeChar(String s, Type t) {

    write('\'');
    StringConverter.stringToUnicodeBytes(this, s, true);
    write('\'');
  }
示例#7
0
 public void writeString(String value) {
   StringConverter.stringToUnicodeBytes(this, value, false);
 }