@Override
  public void readFields(DataInput dataInput) throws IOException {
    dataInput.readFully(internalBytes, 0, 4);
    if (hasDecimalOrSecondVInt(internalBytes[0])) {
      dataInput.readFully(internalBytes, 4, 1);
      int len = (byte) WritableUtils.decodeVIntSize(internalBytes[4]);
      if (len > 1) {
        dataInput.readFully(internalBytes, 5, len - 1);
      }

      long vlong = LazyBinaryUtils.readVLongFromByteArray(internalBytes, 4);
      Preconditions.checkState(vlong >= -1000000000 && vlong <= 999999999,
          "Invalid nanos value for a TimestampTZWritable: " + vlong +
              ", expected to be between -1000000000 and 999999999.");
      if (vlong < 0) {
        // This indicates there is a second VInt containing the additional bits of the seconds
        // field.
        dataInput.readFully(internalBytes, 4 + len, 1);
        int secondVIntLen = (byte) WritableUtils.decodeVIntSize(internalBytes[4 + len]);
        if (secondVIntLen > 1) {
          dataInput.readFully(internalBytes, 5 + len, secondVIntLen - 1);
        }
      }
    }
    currentBytes = internalBytes;
    offset = 0;
    timestampTZEmpty = true;
    bytesEmpty = false;
  }
@return double representation of the timestampTZ, accurate to microseconds
serde/src/java/org/apache/hadoop/hive/serde2/io/TimestampLocalTZWritable.java