|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jwat.warc.WarcReaderFactory
public class WarcReaderFactory
Factory used for creating WarcReader instances.
The general getReader methods will auto-detect Gzip'ed data
and return the appropriate WarcReader instances.
The other factory methods can be used to return specific
WarcReader instances for compressed or uncompressed records.
Readers are available for both sequential and random reading of records.
Use of buffered methods and/or buffering speeds up the reader considerably.
| Field Summary | |
|---|---|
static int |
PUSHBACK_BUFFER_SIZE
Buffer size used by PushbackInputStream. |
| Constructor Summary | |
|---|---|
protected |
WarcReaderFactory()
Private constructor to enforce factory method. |
| Method Summary | |
|---|---|
static WarcReader |
getReader(InputStream in)
Creates a new WarcReader from an InputStream. |
static WarcReader |
getReader(InputStream in,
int buffer_size)
Creates a new WarcReader from an InputStream
wrapped by a BufferedInputStream. |
static WarcReader |
getReaderCompressed()
Creates a new WarcReader without any associated
InputStream for random access to GZip compressed records. |
static WarcReader |
getReaderCompressed(InputStream in)
Creates a new WarcReader from an InputStream
primarily for random access to GZip compressed records. |
static WarcReader |
getReaderCompressed(InputStream in,
int buffer_size)
Creates a new WarcReader from an InputStream
wrapped by a BufferedInputStream primarily for random
access to GZip compressed records. |
static WarcReader |
getReaderUncompressed()
Creates a new WarcReader without any associated
InputStream for random access to uncompressed records. |
static WarcReader |
getReaderUncompressed(InputStream in)
Creates a new WarcReader from an InputStream
primarily for random access to uncompressed records. |
static WarcReader |
getReaderUncompressed(InputStream in,
int buffer_size)
Creates a new WarcReader from an InputStream
wrapped by a BufferedInputStream primarily for random
access to uncompressed records. |
static boolean |
isWarcFile(ByteCountingPushBackInputStream pbin)
Check head of PushBackInputStream for a WARC magic number. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PUSHBACK_BUFFER_SIZE
PushbackInputStream.
| Constructor Detail |
|---|
protected WarcReaderFactory()
| Method Detail |
|---|
public static boolean isWarcFile(ByteCountingPushBackInputStream pbin)
throws IOException
PushBackInputStream for a WARC magic number.
pbin - PushBackInputStream with WARC records
IOException - if an io error occurs while examining head of stream
public static WarcReader getReader(InputStream in,
int buffer_size)
throws IOException
WarcReader from an InputStream
wrapped by a BufferedInputStream.
The WarcReader implementation returned is chosen based on
GZip auto detection.
in - WARC File represented as InputStreambuffer_size - buffer size to use
WarcReader based on data read from
InputStream
IOException - if an exception occurs during initialization
public static WarcReader getReader(InputStream in)
throws IOException
WarcReader from an InputStream.
The WarcReader implementation returned is chosen based on
GZip auto detection.
in - WARC File represented as InputStream
WarcReader based on data read from
InputStream
IOException - if an exception occurs during initializationpublic static WarcReader getReaderUncompressed()
WarcReader without any associated
InputStream for random access to uncompressed records.
WarcReader for uncompressed records read from
InputStream
public static WarcReader getReaderUncompressed(InputStream in)
throws IOException
WarcReader from an InputStream
primarily for random access to uncompressed records.
in - WARC File represented as InputStream
WarcReader for uncompressed records read from
InputStream
IOException - io exception while initializing reader
public static WarcReader getReaderUncompressed(InputStream in,
int buffer_size)
throws IOException
WarcReader from an InputStream
wrapped by a BufferedInputStream primarily for random
access to uncompressed records.
in - WARC File represented as InputStreambuffer_size - buffer size to use
WarcReader for uncompressed records read from
InputStream
IOException - io exception while initializing readerpublic static WarcReader getReaderCompressed()
WarcReader without any associated
InputStream for random access to GZip compressed records.
WarcReader for GZip compressed records read from
InputStream
public static WarcReader getReaderCompressed(InputStream in)
throws IOException
WarcReader from an InputStream
primarily for random access to GZip compressed records.
in - WARC File represented as InputStream
WarcReader for GZip compressed records read from
InputStream
IOException - io exception while initializing reader
public static WarcReader getReaderCompressed(InputStream in,
int buffer_size)
throws IOException
WarcReader from an InputStream
wrapped by a BufferedInputStream primarily for random
access to GZip compressed records.
in - WARC File represented as InputStreambuffer_size - buffer size to use
WarcReader for GZip compressed records read from
InputStream
IOException - io exception while initializing reader
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||