public String readVarchar() throws IOException {
    int varcharLength = readUnsignedShort();
    byte[] varcharContent = new byte[varcharLength];
    int numOfBytesRead = in.read(varcharContent);
    if (varcharContent.length != 0 && numOfBytesRead != varcharLength) {
      throw new EOFException(
          format("Fail to read the varchar. Expect %d bytes, get %d bytes", varcharLength, numOfBytesRead));
    }
    //force it to be UTF8 string
    return new String(varcharContent, "UTF8");
  }
Read 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.

@return the string
@throws IOException the io exception
serde/src/java/org/apache/hadoop/hive/serde2/teradata/TeradataBinaryDataInputStream.java