public void writeVarChar(HiveVarcharWritable writable) throws IOException {
    if (writable == null) {
      EndianUtils.writeSwappedShort(this, (short) 0);
      return;
    }
    Text t = writable.getTextValue();
    int varcharLength = t.getLength();
    EndianUtils.writeSwappedShort(this, (short) varcharLength); // write the varchar length
    write(t.getBytes(), 0, varcharLength); // write the varchar content
  }
Write VARCHAR(N).
The representation of Varchar in Teradata binary format is:
the first two bytes represent the length N of this varchar field,
the next N bytes represent the content of this varchar field.
To pad the null varchar, the length will be 0 and the content will be none.

@param writable the writable
@throws IOException the io exception
serde/src/java/org/apache/hadoop/hive/serde2/teradata/TeradataBinaryDataOutputStream.java