CompoundDocument(final SeekableInputStream stream) throws IOException { input = new SeekableLittleEndianDataInputStream(stream); // TODO: Might be better to read header on first read operation?! // OTOH: It's also good to be fail-fast, so at least we should make // sure we're reading a valid document readHeader(); }
/** * Creates a read only {@code CompoundDocument}. * * @param input the input to read from * * @throws IOException if an I/O exception occurs while reading the header */ public CompoundDocument(final ImageInputStream input) throws IOException { this.input = notNull(input, "input"); // This implementation only supports little endian (Intel) CompoundDocuments input.setByteOrder(ByteOrder.LITTLE_ENDIAN); // TODO: Might be better to read header on first read operation?! // OTOH: It's also good to be fail-fast, so at least we should make // sure we're reading a valid document readHeader(); }
/** * Creates a (for now) read only {@code CompoundDocument}. * <p/> * <em>Warning! You must invoke {@link #close()} on the compound document * created from this constructor when done, to avoid leaking file * descriptors.</em> * * @param file the file to read from * * @throws IOException if an I/O exception occurs while reading the header */ public CompoundDocument(final File file) throws IOException { // TODO: We need to close this (or it's underlying RAF)! Otherwise we're leaking file descriptors! input = new LittleEndianRandomAccessFile(FileUtil.resolve(file), "r"); // TODO: Might be better to read header on first read operation?! // OTOH: It's also good to be fail-fast, so at least we should make // sure we're reading a valid document readHeader(); }
/** * Creates a read only {@code CompoundDocument}. * * @param pInput the input to read from * * @throws IOException if an I/O exception occurs while reading the header */ public CompoundDocument(final ImageInputStream pInput) throws IOException { input = pInput; // TODO: Might be better to read header on first read operation?! // OTOH: It's also good to be fail-fast, so at least we should make // sure we're reading a valid document readHeader(); }
/** * Creates a read only {@code CompoundDocument}. * * @param pInput the input to read from * * @throws IOException if an I/O exception occurs while reading the header */ public CompoundDocument(final ImageInputStream pInput) throws IOException { mInput = pInput; // TODO: Might be better to read header on first read operation?! // OTOH: It's also good to be fail-fast, so at least we should make // sure we're reading a valid document readHeader(); }
CompoundDocument(final SeekableInputStream pInput) throws IOException { mInput = new SeekableLittleEndianDataInputStream(pInput); // TODO: Might be better to read header on first read operation?! // OTOH: It's also good to be fail-fast, so at least we should make // sure we're reading a valid document readHeader(); }
CompoundDocument(final SeekableInputStream pInput) throws IOException { input = new SeekableLittleEndianDataInputStream(pInput); // TODO: Might be better to read header on first read operation?! // OTOH: It's also good to be fail-fast, so at least we should make // sure we're reading a valid document readHeader(); }
/** * Creates a (for now) read only {@code CompoundDocument}. * * @param pFile the file to read from * * @throws IOException if an I/O exception occurs while reading the header */ public CompoundDocument(final File pFile) throws IOException { input = new LittleEndianRandomAccessFile(FileUtil.resolve(pFile), "r"); // TODO: Might be better to read header on first read operation?! // OTOH: It's also good to be fail-fast, so at least we should make // sure we're reading a valid document readHeader(); }
/** * Creates a (for now) read only {@code CompoundDocument}. * * @param pFile the file to read from * * @throws IOException if an I/O exception occurs while reading the header */ public CompoundDocument(final File pFile) throws IOException { mInput = new LittleEndianRandomAccessFile(FileUtil.resolve(pFile), "r"); // TODO: Might be better to read header on first read operation?! // OTOH: It's also good to be fail-fast, so at least we should make // sure we're reading a valid document readHeader(); }