| java.lang.Object java.io.InputStream org.archive.io.ArchiveRecord org.archive.io.arc.ARCRecord
ARCRecord | public class ARCRecord extends ArchiveRecord implements ARCConstants(Code) | | An ARC file record.
Does not compass the ARCRecord metadata line, just the record content.
author: stack |
Constructor Summary | |
public | ARCRecord(InputStream in, ArchiveRecordHeader metaData) Constructor. | public | ARCRecord(InputStream in, ArchiveRecordHeader metaData, int bodyOffset, boolean digest, boolean strict, boolean parseHttpHeaders) Constructor.
Parameters: in - Stream cue'd up to be at the start of the record this instanceis to represent. Parameters: metaData - Meta data. Parameters: bodyOffset - Offset into the body. |
ARCRecord | public ARCRecord(InputStream in, ArchiveRecordHeader metaData, int bodyOffset, boolean digest, boolean strict, boolean parseHttpHeaders) throws IOException(Code) | | Constructor.
Parameters: in - Stream cue'd up to be at the start of the record this instanceis to represent. Parameters: metaData - Meta data. Parameters: bodyOffset - Offset into the body. Usually 0. Parameters: digest - True if we're to calculate digest for this record. Notdigesting saves about ~15% of cpu during an ARC parse. Parameters: strict - Be strict parsing (Parsing stops if ARC inproperlyformatted). Parameters: parseHttpHeaders - True if we are to parse HTTP headers. Costsabout ~20% of CPU during an ARC parse. throws: IOException - |
getBodyOffset | public int getBodyOffset()(Code) | | Offset at which the body begins (Only known afterheader has been read) or -1 if none or if we haven't readheaders yet. Usually length of HTTP headers (does not include ARCmetadata line length). |
getHttpHeaders | public Header[] getHttpHeaders()(Code) | | http headers (Only available after header has been read). |
getStatusCode | public int getStatusCode()(Code) | | Return status code for this record.
This method will return -1 until the http header has been read.
Status code. |
read | public int read() throws IOException(Code) | | Next character in this ARCRecord's content else -1 if at end ofthis record. throws: IOException - |
skipHttpHeader | public void skipHttpHeader() throws IOException(Code) | | Skip over the the http header if one present.
Subsequent reads will get the body.
Calling this method in the midst of reading the header
will make for strange results. Otherwise, safe to call
at any time though before reading any of the arc record
content is only time that it makes sense.
After calling this method, you can call
ARCRecord.getHttpHeaders() to get the read http header.
throws: IOException - |
|
|