|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.netarkivet.common.utils.arc.ShareableARCRecord
public class ShareableARCRecord
Class for reading a record in an ARC file. This class wraps around an org.archive.io.arc.ARCRecord. The main functionality added is that this class can return InputStreams to the record object at will, allowing multiple consumers to share the object. A ShareableARCRecord can also tell which file the current record was found in (useful for indexing).
Constructor Summary | |
---|---|
ShareableARCRecord(org.archive.io.arc.ARCRecord record,
java.io.File fromFile)
Creates a ShareableARCRecord from an ARCRecord and the File in which the ARCRecord was found. |
Method Summary | |
---|---|
org.archive.io.arc.ARCRecord |
getARCRecord()
Returns the ARC record around which the ShareableARCRecord is based. |
ReadOnlyByteArray |
getDataReadOnly()
Reads all the data in the ARCRecord's InputStream. |
java.io.File |
getFile()
Returns the file that this ARC record comes from. |
org.archive.io.arc.ARCRecordMetaData |
getMetaData()
Returns the metadata of this ARC record. |
java.io.InputStream |
getObjectAsInputStream()
Allows the caller to read the record object itself. |
byte[] |
readAll()
Reads all the data in the ARCRecord's InputStream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShareableARCRecord(org.archive.io.arc.ARCRecord record, java.io.File fromFile)
record
- - an ARCRecord that the return object
should wrap around. Note that this object does not close
the record, but holds on to the record. The record can
be closed after readAll(), getDataReadOnly() or getObjectAsInputStream()
has been called.fromFile
- - the ARC file in which the ARCRecord was
found.Method Detail |
---|
public java.io.File getFile()
public org.archive.io.arc.ARCRecordMetaData getMetaData()
public byte[] readAll() throws java.io.IOException
java.io.IOException
- if reading failspublic ReadOnlyByteArray getDataReadOnly() throws java.io.IOException
java.io.IOException
- if reading failspublic java.io.InputStream getObjectAsInputStream() throws java.io.IOException
java.io.IOException
- if there are problems reading the objectpublic org.archive.io.arc.ARCRecord getARCRecord()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |