Class WARCReaderFactory.CompressedWARCReader
java.lang.Object
org.archive.io.ArchiveReader
org.archive.io.warc.WARCReader
org.archive.io.warc.WARCReaderFactory.CompressedWARCReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<ArchiveRecord>
- Enclosing class:
WARCReaderFactory
Compressed WARC file reader.
- Version:
- $Date: 2006-08-23 17:59:04 -0700 (Wed, 23 Aug 2006) $ $Version$
- 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.CompressedWARCReader(File f, long offset) Constructor.CompressedWARCReader(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.warc.WARCReader
createArchiveRecord, createCDXIndexFile, dump, getDeleteFileOnCloseReader, getDotFileExtension, getFileExtension, initialize, main, output, readExpectedCharMethods inherited from class org.archive.io.ArchiveReader
cdxOutput, cleanupCurrentRecord, close, currentRecord, get, getCurrentRecord, getFileName, getIn, getInputStream, getLogger, getOptions, getReaderIdentifier, getStrippedFileName, getStrippedFileName, getTrueOrFalse, getVersion, isCompressed, isDigest, isStrict, isValid, logStdErr, output, outputRecord, 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
-
CompressedWARCReader
Constructor.- Parameters:
f- Compressed file to read.- Throws:
IOException
-
CompressedWARCReader
Constructor.- Parameters:
f- Compressed arcfile to read.offset- Position at where to start reading file.- Throws:
IOException
-
CompressedWARCReader
Constructor.- Parameters:
f- Compressed arcfile.is- InputStream to use.atFirstRecord-- Throws:
IOException
-
-
Method Details
-
get
Get record at passedoffset.- Overrides:
getin classArchiveReader- Parameters:
offset- Byte index into file at which a record starts.- Returns:
- A WARCRecord 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:WARCReaderSkip over any trailing new lines at end of the record so we're lined up ready to read the next.- Overrides:
gotoEORin classWARCReader- Parameters:
rec-- Throws:
IOException
-