public String readChar(int totalLength) throws IOException {
    byte[] charContent = new byte[totalLength];
    int numOfBytesRead = in.read(charContent);
    if (charContent.length != 0 && numOfBytesRead != totalLength) {
      throw new EOFException(
          format("Fail to read the varchar. Expect %d bytes, get %d bytes", totalLength, numOfBytesRead));
    }
    return new String(charContent, "UTF8");
  }
Read CHAR(N).
The representation of char in Teradata binary format is
the byte number to read is based on the [charLength] * [bytePerChar] &lt;- totalLength,
bytePerChar is decided by the charset: LATIN charset is 2 bytes per char and UNICODE charset is 3 bytes per char.
the null char will use space to pad.

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