com.twelvemonkeys.io.ole2
Class CompoundDocument

java.lang.Object
  extended by com.twelvemonkeys.io.ole2.CompoundDocument

public final class CompoundDocument
extends Object

Represents a read-only OLE2 compound document.

NOTE: This class is not synchronized. Accessing the document or its entries from different threads, will need synchronization on the document instance.

Version:
$Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/ole2/CompoundDocument.java#4 $
Author:
Harald Kuhr, last modified by $Author: haku $

Field Summary
static long EPOCH_OFFSET
          The epoch offset of CompoundDocument time stamps
static int HEADER_SIZE
           
 
Constructor Summary
CompoundDocument(File pFile)
          Creates a (for now) read only CompoundDocument.
CompoundDocument(ImageInputStream pInput)
          Creates a read only CompoundDocument.
CompoundDocument(InputStream pInput)
          Creates a read only CompoundDocument.
 
Method Summary
static boolean canRead(DataInput pInput)
           
 Entry getRootEntry()
           
static long toJavaTimeInMillis(long pMSTime)
          Converts the given time stamp to standard Java time representation, milliseconds since January 1, 1970.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HEADER_SIZE

public static final int HEADER_SIZE
See Also:
Constant Field Values

EPOCH_OFFSET

public static final long EPOCH_OFFSET
The epoch offset of CompoundDocument time stamps

See Also:
Constant Field Values
Constructor Detail

CompoundDocument

public CompoundDocument(File pFile)
                 throws IOException
Creates a (for now) read only CompoundDocument.

Parameters:
pFile - the file to read from
Throws:
IOException - if an I/O exception occurs while reading the header

CompoundDocument

public CompoundDocument(InputStream pInput)
                 throws IOException
Creates a read only CompoundDocument.

Parameters:
pInput - the input to read from
Throws:
IOException - if an I/O exception occurs while reading the header

CompoundDocument

public CompoundDocument(ImageInputStream pInput)
                 throws IOException
Creates a read only CompoundDocument.

Parameters:
pInput - the input to read from
Throws:
IOException - if an I/O exception occurs while reading the header
Method Detail

canRead

public static boolean canRead(DataInput pInput)

getRootEntry

public Entry getRootEntry()
                   throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

toJavaTimeInMillis

public static long toJavaTimeInMillis(long pMSTime)
Converts the given time stamp to standard Java time representation, milliseconds since January 1, 1970. The time stamp parameter is assumed to be in units of 100 nano seconds since January 1, 1601.

If the timestamp is 0L (meaning not specified), no conversion is done, to behave like java.io.File.

Parameters:
pMSTime - an unsigned long value representing the time stamp (in units of 100 nano seconds since January 1, 1601).
Returns:
the time stamp converted to Java time stamp in milliseconds, or 0L if pMSTime == 0L


Copyright © 2015. All Rights Reserved.