public void writeVarByte(BytesWritable writable) throws IOException {
    if (writable == null) {
      EndianUtils.writeSwappedShort(this, (short) 0);
      return;
    }
    int varbyteLength = writable.getLength();
    EndianUtils.writeSwappedShort(this, (short) varbyteLength); // write the varbyte length
    write(writable.getBytes(), 0, varbyteLength); // write the varchar content
  }
Write VARBYTE(N).
The representation of VARBYTE 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 varbyte, 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