Class ARCReaderFactory.CompressedARCReader
java.lang.Object
org.archive.io.ArchiveReader
org.archive.io.arc.ARCReader
org.archive.io.arc.ARCReaderFactory.CompressedARCReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<ArchiveRecord>
- Enclosing class:
ARCReaderFactory
Compressed arc file reader.
- Author:
- stack
-
Nested Class Summary
Nested classes/interfaces inherited from class org.archive.io.ArchiveReader
ArchiveReader.ArchiveRecordIterator -
Field Summary
Fields inherited from class org.archive.io.ArchiveReader
in, MAX_ALLOWED_RECOVERABLES -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.CompressedARCReader(File f, long offset) Constructor.CompressedARCReader(String f, InputStream is, boolean atFirstRecord) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionget(long offset) Get record at passedoffset.protected voidgotoEOR(ArchiveRecord rec) Skip over any trailing new lines at end of the record so we're lined up ready to read the next.iterator()Returns an ArchiveRecord iterator.Methods inherited from class org.archive.io.arc.ARCReader
createArchiveRecord, createCDXIndexFile, dump, getDeleteFileOnCloseReader, getDotFileExtension, getFileExtension, getVersion, isAlignedOnFirstRecord, isParseHttpHeaders, main, output, output, outputRecord, setAlignedOnFirstRecord, setParseHttpHeadersMethods inherited from class org.archive.io.ArchiveReader
cdxOutput, cleanupCurrentRecord, close, currentRecord, get, getCurrentRecord, getFileName, getIn, getInputStream, getLogger, getOptions, getReaderIdentifier, getStrippedFileName, getStrippedFileName, getTrueOrFalse, initialize, isCompressed, isDigest, isStrict, isValid, logStdErr, outputRecord, positionForRecord, setCompressed, setDigest, setIn, setReaderIdentifier, setStrict, setVersion, stripExtension, validate, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CompressedARCReader
Constructor.- Parameters:
f- Compressed arcfile to read.- Throws:
IOException
-
CompressedARCReader
Constructor.- Parameters:
f- Compressed arcfile to read.offset- Position at where to start reading file.- Throws:
IOException
-
CompressedARCReader
Constructor.- Parameters:
f- Compressed arcfile.is- InputStream to use.- Throws:
IOException
-
-
Method Details
-
get
Get record at passedoffset.- Overrides:
getin classArchiveReader- Parameters:
offset- Byte index into arcfile at which a record starts.- Returns:
- An ARCRecord reference.
- Throws:
IOException
-
iterator
Description copied from class:ArchiveReaderReturns an ArchiveRecord iterator. Of note, on IOException, especially if ZipException reading compressed ARCs, rather than fail the iteration, try moving to the next record. IfArchiveReader.strictis not set, this will usually succeed.- Specified by:
iteratorin interfaceIterable<ArchiveRecord>- Overrides:
iteratorin classArchiveReader- Returns:
- An iterator over ARC records.
-
gotoEOR
Description copied from class:ARCReaderSkip over any trailing new lines at end of the record so we're lined up ready to read the next.- Overrides:
gotoEORin classARCReader- Parameters:
rec-- Throws:
IOException
-