org.at4j.support.util
Class MsDosTime

java.lang.Object
  extended by org.at4j.support.util.MsDosTime

public final class MsDosTime
extends Object

This class contains static utility methods for working with MS DOS times. An MS DOS time is a time in a day with two second precision. It can be encoded in two bytes.

See the Microsoft documentation.

Since:
1.0
Author:
Karl Gustafsson
See Also:
MsDosDate

Method Summary
static UnsignedShort encodeMsDosTime(Calendar cal)
          Encode the MS DOS time (hour of day, minute and second with two-second precision) stored in the supplied Calendar object to an unsigned short value.
static void parseMsDosTime(UnsignedShort s, Calendar cal)
          Parse the MS DOS time (hour of day, minute and second with two-second precision) encoded in the supplied unsigned short value and update the calendar object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseMsDosTime

public static void parseMsDosTime(UnsignedShort s,
                                  Calendar cal)
                           throws IllegalArgumentException
Parse the MS DOS time (hour of day, minute and second with two-second precision) encoded in the supplied unsigned short value and update the calendar object.

The time should be encoded as described here.

Parameters:
s - The encoded time.
cal - The calendar to update with the time.
Throws:
IllegalArgumentException - If the encoded time is invalid.

encodeMsDosTime

public static UnsignedShort encodeMsDosTime(Calendar cal)
Encode the MS DOS time (hour of day, minute and second with two-second precision) stored in the supplied Calendar object to an unsigned short value.

The time is encoded as described here.

Parameters:
cal - The calendar object containing the time to encode.
Returns:
The encoded time.