public final class CompoundDocument extends Object implements 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(File file)
Creates a (for now) read only
CompoundDocument. |
CompoundDocument(ImageInputStream input)
Creates a read only
CompoundDocument. |
CompoundDocument(InputStream pInput)
Creates a read only
CompoundDocument. |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canRead(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.
|
String |
toString() |
public static final int HEADER_SIZE
public static final long EPOCH_OFFSET
public CompoundDocument(File file) throws 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 fromIOException - if an I/O exception occurs while reading the headerpublic CompoundDocument(InputStream pInput) throws IOException
CompoundDocument.pInput - the input to read from.IOException - if an I/O exception occurs while reading the headerpublic CompoundDocument(ImageInputStream input) throws IOException
CompoundDocument.input - the input to read fromIOException - if an I/O exception occurs while reading the headerpublic void close()
throws IOException
RandomAccessFile if any,
but will leave any stream created outside the document open.close in interface AutoCloseableIOException - if an I/O error occurs.CompoundDocument(File),
RandomAccessFile.close()public static boolean canRead(DataInput pInput)
public Entry getRootEntry() throws IOException
IOExceptionpublic 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 © 2023. All rights reserved.