public Timestamp readTimestamp(Integer byteNum) throws IOException {
    // yyyy-mm-dd hh:mm:ss
    byte[] timestampContent = new byte[byteNum];
    int numOfBytesRead = in.read(timestampContent);
    if (timestampContent.length != 0 && numOfBytesRead != byteNum) {
      throw new EOFException(
          format("Fail to read the timestamp. Expect %d bytes, get %d bytes", byteNum, numOfBytesRead));
    }
    String timestampStr = new String(timestampContent, "UTF8");
    if (timestampStr.trim().length() == 0) {
      return null;
    }
    return Timestamp.valueOf(timestampStr);
  }
Read TIMESTAMP(P).
The representation of timestamp in Teradata binary format is:
the byte number to read is based on the precision of timestamp,
each byte represents one char and the timestamp is using string representation,
eg: for TIMESTAMP(6), we need to read 26 bytes
31 39  31 31 2d 31 31 2d 31 31 20 31 39 3a 32 30 3a 32 31 2e 34 33 33 32 30 30
will represent 1911-11-11 19:20:21.433200.
the null timestamp will use space to pad.

@param byteNum the byte number that will be read from inputstream
@return the timestamp
@throws IOException the io exception
serde/src/java/org/apache/hadoop/hive/serde2/teradata/TeradataBinaryDataInputStream.java