Read a Synchro time from an input stream.

@param is input stream
@return Date instance
970102
public static final Date getTime(InputStream is) throws IOException
   {
      int timeValue = getInt(is);
      timeValue -= 86400;
      timeValue /= 60;
      return DateHelper.getTimeFromMinutesPastMidnight(Integer.valueOf(timeValue));
   }
986048
private void readHeader(InputStream is) throws IOException
   {
      byte[] header = new byte[20];
      is.read(header);
      m_offset += 20;
      SynchroLogger.log("HEADER", header);   
   }
210998
protected String getTimestamp() {
        final Date date = new Date(System.currentTimeMillis());
        final DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
        return formatter.format(date);
    }
321657
private String getTimestamp() {
		if (timeOffset == null)
			syncTime();
		long now = System.currentTimeMillis() / 1000L;
		now -= timeOffset;
		return Long.toString(now);
	}
91777
private List<SynchroTable> readTableHeaders(InputStream is) throws IOException
   {
      // Read the headers
      List<SynchroTable> tables = new ArrayList<SynchroTable>();
      byte[] header = new byte[48];
      while (true)
      {
         is.read(header);
         m_offset += 48;
         SynchroTable table = readTableHeader(header);
         if (table == null)
         {
            break;
         }
         tables.add(table);
      }

      // Ensure sorted by offset
      Collections.sort(tables, new Comparator<SynchroTable>()
      {
         @Override public int compare(SynchroTable o1, SynchroTable o2)
         {
            return o1.getOffset() - o2.getOffset();
         }
      });

      // Calculate lengths
      SynchroTable previousTable = null;
      for (SynchroTable table : tables)
      {
         if (previousTable != null)
         {
            previousTable.setLength(table.getOffset() - previousTable.getOffset());
         }

         previousTable = table;
      }

      for (SynchroTable table : tables)
      {
         SynchroLogger.log("TABLE", table);
      }

      return tables;
   }
1309306
public static Date getTimestamp(JsonNode node) {
		String text = obj(node).get(ID_TIMESTAMP).asText();
		return isNotBlank(text) ? from(instantUtc(text)).toDate() : null;
	}
149146
private static byte[] getBytes(InputStream is) throws IOException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();

        byte[] buf = new byte[4096];

        while (true) {
            int r = is.read(buf);
            if (r == -1) {
                out.flush();
                return out.toByteArray();
            }
            out.write(buf, 0, r);
        }
    }
235723
protected Timestamp readTimestamp() throws IOException {
		int inc = _in.readInt();
		int time = _in.readInt();
		return new Timestamp(time, inc);
	}
472989
public static String getTimestamp(Date time) {
        return getTimestampFormatter().format(time == null ? new Date() : time);
    }
1156027
private Optional<TemporalAccessor> touchDate(AuditableBeanWrapper<?> wrapper,
			boolean isNew) {

		Assert.notNull(wrapper, "AuditableBeanWrapper must not be null!");

		Optional<TemporalAccessor> now = dateTimeProvider.getNow();

		Assert.notNull(now, () -> String.format("Now must not be null! Returned by: %s!",
				dateTimeProvider.getClass()));

		now.filter(__ -> isNew).ifPresent(it -> wrapper.setCreatedDate(it));
		now.filter(__ -> !isNew || modifyOnCreation)
				.ifPresent(it -> wrapper.setLastModifiedDate(it));

		return now;
	}
369248
public static Date
parse(String s) throws TextParseException {
	if (s.length() != 14) {
		throw new TextParseException("Invalid time encoding: " + s);
	}

	Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
	c.clear();
	try {
		int year = Integer.parseInt(s.substring(0, 4));
		int month = Integer.parseInt(s.substring(4, 6)) - 1;
		int date = Integer.parseInt(s.substring(6, 8));
		int hour = Integer.parseInt(s.substring(8, 10));
		int minute = Integer.parseInt(s.substring(10, 12));
		int second = Integer.parseInt(s.substring(12, 14));
		c.set(year, month, date, hour, minute, second);
	}
	catch (NumberFormatException e) {
		throw new TextParseException("Invalid time encoding: " + s);
	}
	return c.getTime();
}
854666
private static long parseLockTimeStr(String lockTimeStr) throws ParseException {
        if (lockTimeStr.indexOf("/") != -1) {
            SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd", Locale.US);
            Date date = format.parse(lockTimeStr);
            return date.getTime() / 1000;
        }
        return Long.parseLong(lockTimeStr);
    }
1372632
private static byte[] readAllBytes(InputStream is) throws IOException {
        byte[] buffer = new byte[8192];
        ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
        int n;
        while ((n = is.read(buffer)) != -1) {
            baos.write(buffer, 0, n);
        }
        return baos.toByteArray();
    }
676407
private void readObject(ObjectInputStream stream)
                         throws IOException, ClassNotFoundException {
        stream.defaultReadObject();

        try {
            compiledPattern = compile(pattern);
        } catch (Exception e) {
            throw new InvalidObjectException("invalid pattern");
        }

        if (serialVersionOnStream < 1) {
            // didn't have defaultCenturyStart field
            initializeDefaultCentury();
        }
        else {
            // fill in dependent transient field
            parseAmbiguousDatesAsAfter(defaultCenturyStart);
        }
        serialVersionOnStream = currentSerialVersion;

        // If the deserialized object has a SimpleTimeZone, try
        // to replace it with a ZoneInfo equivalent in order to
        // be compatible with the SimpleTimeZone-based
        // implementation as much as possible.
        TimeZone tz = getTimeZone();
        if (tz instanceof SimpleTimeZone) {
            String id = tz.getID();
            TimeZone zi = TimeZone.getTimeZone(id);
            if (zi != null && zi.hasSameRules(tz) && zi.getID().equals(id)) {
                setTimeZone(zi);
            }
        }
    }
227358
public void read(InputStream is) throws IOException
   {
      byte[] headerBlock = new byte[20];
      is.read(headerBlock);

      int headerLength = PEPUtility.getShort(headerBlock, 8);
      int recordCount = PEPUtility.getInt(headerBlock, 10);
      int recordLength = PEPUtility.getInt(headerBlock, 16);
      StreamHelper.skip(is, headerLength - headerBlock.length);

      byte[] record = new byte[recordLength];
      for (int recordIndex = 1; recordIndex <= recordCount; recordIndex++)
      {
         is.read(record);
         readRow(recordIndex, record);
      }
   }
679642
public static DateFormat getInstance() {
        if (instance == null) {
            synchronized (instanceLock) {
                if (instance == null) {
                    instance = new ResqueDateFormatThreadLocal();
                }
            }
        }
        return instance.get();
    }
678965
@Nullable
  public Date timestamp() {
    // It's unclear if this will ever be null. So we're being safe.
    String timestamp = getString(TIMESTAMP_KEY);
    if (isNullOrEmpty(timestamp)) {
      return null;
    }
    return parseISO8601Date(timestamp);
  }