org.apache.poi.hpsf
Class Util

java.lang.Object
  |
  +--org.apache.poi.hpsf.Util

public class Util
extends java.lang.Object

Provides various static utility methods.

Since:
2002-02-09
Version:
$Id: Util.java,v 1.1 2002/02/14 04:00:59 mjohnson Exp $
Author:
Rainer Klute (klute@rainer-klute.de)

Field Summary
static long EPOCH_DIFF
          The difference between the Windows epoch (1601-01-01 00:00:00) and the Unix epoch (1970-01-01 00:00:00) in milliseconds: 11644473600000L.
 
Constructor Summary
Util()
           
 
Method Summary
static byte[] cat(byte[][] byteArrays)
          Concatenates the contents of several byte arrays into a single one.
static byte[] copy(byte[] src, int offset, int length)
          Copies bytes from a source byte array into a new byte array.
static void copy(byte[] src, int srcOffset, int length, byte[] dst, int dstOffset)
          Copies a part of a byte array into another byte array.
static boolean equal(byte[] a, byte[] b)
          Checks whether two byte arrays a and b are equal.
static java.util.Date filetimeToDate(int high, int low)
          Converts a Windows FILETIME into a Date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EPOCH_DIFF

public static final long EPOCH_DIFF

The difference between the Windows epoch (1601-01-01 00:00:00) and the Unix epoch (1970-01-01 00:00:00) in milliseconds: 11644473600000L. (Use your favorite spreadsheet program to verify the correctness of this value. By the way, did you notice that you can tell from the epochs which operating system is the modern one? :-))

Constructor Detail

Util

public Util()
Method Detail

equal

public static boolean equal(byte[] a,
                            byte[] b)

Checks whether two byte arrays a and b are equal. They are equal


copy

public static void copy(byte[] src,
                        int srcOffset,
                        int length,
                        byte[] dst,
                        int dstOffset)

Copies a part of a byte array into another byte array.


cat

public static byte[] cat(byte[][] byteArrays)

Concatenates the contents of several byte arrays into a single one.

Parameters:
byteArrays - The byte arrays to be concatened.
Returns:
A new byte array containing the concatenated byte arrays.

copy

public static byte[] copy(byte[] src,
                          int offset,
                          int length)

Copies bytes from a source byte array into a new byte array.

Parameters:
src - Copy from this byte array.
offset - Start copying here.
length - Copy this many bytes.
Returns:
The new byte array. Its length is number of copied bytes.

filetimeToDate

public static java.util.Date filetimeToDate(int high,
                                            int low)

Converts a Windows FILETIME into a Date. The Windows FILETIME structure holds a date and time associated with a file. The structure identifies a 64-bit integer specifying the number of 100-nanosecond intervals which have passed since January 1, 1601. This 64-bit value is split into the two double word stored in the structure.

Parameters:
high - The higher double word of the FILETIME structure.
low - The lower double word of the FILETIME structure.


Copyright © 2002 Apache jakarta-poi project. All Rights Reserved.