code: public void writeTo(final PacketOutputStream pos) throws IOException {
      SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
      sdf.setTimeZone(timeZone);
      String dateString = sdf.format(time);
  
      pos.write(QUOTE);
      pos.write(dateString.getBytes());
      int microseconds = (int) (time.getTime() % 1000) * 1000;
      if (microseconds > 0 && fractionalSeconds) {
        pos.write('.');
        int factor = 100000;
        while (microseconds > 0) {
          int dig = microseconds / factor;
          pos.write('0' + dig);
          microseconds -= dig * factor;
          factor /= 10;
        }
      }
      pos.write(QUOTE);
    }
docs: Write Time parameter to outputStream.
  
  @param pos the stream to write to