public final class CompoundDocument
extends java.lang.Object
implements java.lang.AutoCloseable
NOTE: This class is not synchronized. Accessing the document or its entries from different threads, will need synchronization on the document instance.
| Modifier and Type | Field and Description |
|---|---|
static long |
EPOCH_OFFSET
The epoch offset of CompoundDocument time stamps
|
static int |
HEADER_SIZE |
| Constructor and Description |
|---|
CompoundDocument(java.io.File file)
Creates a (for now) read only
CompoundDocument. |
CompoundDocument(javax.imageio.stream.ImageInputStream input)
Creates a read only
CompoundDocument. |
CompoundDocument(java.io.InputStream pInput)
Creates a read only
CompoundDocument. |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canRead(java.io.DataInput pInput) |
void |
close()
This method will close the underlying
RandomAccessFile if any,
but will leave any stream created outside the document open. |
Entry |
getRootEntry() |
static long |
toJavaTimeInMillis(long pMSTime)
Converts the given time stamp to standard Java time representation,
milliseconds since January 1, 1970.
|
java.lang.String |
toString() |
public static final int HEADER_SIZE
public static final long EPOCH_OFFSET
public CompoundDocument(java.io.File file)
throws java.io.IOException
CompoundDocument.
Warning! You must invoke close() on the compound document
created from this constructor when done, to avoid leaking file
descriptors.
file - the file to read fromjava.io.IOException - if an I/O exception occurs while reading the headerpublic CompoundDocument(java.io.InputStream pInput)
throws java.io.IOException
CompoundDocument.pInput - the input to read from.java.io.IOException - if an I/O exception occurs while reading the headerpublic CompoundDocument(javax.imageio.stream.ImageInputStream input)
throws java.io.IOException
CompoundDocument.input - the input to read fromjava.io.IOException - if an I/O exception occurs while reading the headerpublic void close()
throws java.io.IOException
RandomAccessFile if any,
but will leave any stream created outside the document open.close in interface java.lang.AutoCloseablejava.io.IOException - if an I/O error occurs.CompoundDocument(File),
RandomAccessFile.close()public static boolean canRead(java.io.DataInput pInput)
public Entry getRootEntry() throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic static long toJavaTimeInMillis(long pMSTime)
If the timestamp is 0L (meaning not specified), no conversion
is done, to behave like java.io.File.
pMSTime - an unsigned long value representing the time stamp (in
units of 100 nano seconds since January 1, 1601).0L if pMSTime == 0LCopyright © 2020. All Rights Reserved.