org.jwat.warc
Class WarcWriterCompressed

java.lang.Object
  extended by org.jwat.warc.WarcWriter
      extended by org.jwat.warc.WarcWriterCompressed

public class WarcWriterCompressed
extends WarcWriter

WARC Writer implementation for writing GZip compressed files.

Author:
nicl

Field Summary
protected  GzipEntry entry
          Current GZip entry.
protected  GzipWriter writer
          GZip Writer used.
 
Fields inherited from class org.jwat.warc.WarcWriter
bExceptionOnContentLengthMismatch, diagnostics, fieldParser, header, headerContentLength, out, payloadWrittenTotal, S_HEADER_WRITTEN, S_INIT, S_PAYLOAD_WRITTEN, S_RECORD_CLOSED, state, stream_copy_buffer, warcDateFormat
 
Method Summary
 void close()
          Close WARC writer and free its resources.
 void closeRecord()
          Close the WARC record.
 boolean isCompressed()
          Is this writer producing compressed output.
 long streamPayload(InputStream in)
           
 void writeHeader(byte[] header_bytes, Long contentLength)
          Write a raw WARC header to the WARC output stream.
 byte[] writeHeader(WarcRecord record)
          Write a WARC header to the WARC output stream.
 long writePayload(byte[] b)
           
 long writePayload(byte[] b, int offset, int len)
           
 
Methods inherited from class org.jwat.warc.WarcWriter
closeRecord_impl, exceptionOnContentLengthMismatch, init, setExceptionOnContentLengthMismatch, writeHeader_impl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writer

protected GzipWriter writer
GZip Writer used.


entry

protected GzipEntry entry
Current GZip entry.

Method Detail

isCompressed

public boolean isCompressed()
Description copied from class: WarcWriter
Is this writer producing compressed output.

Specified by:
isCompressed in class WarcWriter
Returns:
boolean indicating whether compressed output is produced

close

public void close()
Description copied from class: WarcWriter
Close WARC writer and free its resources.

Specified by:
close in class WarcWriter

closeRecord

public void closeRecord()
                 throws IOException
Description copied from class: WarcWriter
Close the WARC record.

Specified by:
closeRecord in class WarcWriter
Throws:
IOException - if an exception occurs while closing the record

writeHeader

public void writeHeader(byte[] header_bytes,
                        Long contentLength)
                 throws IOException
Description copied from class: WarcWriter
Write a raw WARC header to the WARC output stream.

Overrides:
writeHeader in class WarcWriter
Parameters:
header_bytes - raw WARC record to output
Throws:
IOException - if an exception occurs while writing header data

writeHeader

public byte[] writeHeader(WarcRecord record)
                   throws IOException
Description copied from class: WarcWriter
Write a WARC header to the WARC output stream.

Specified by:
writeHeader in class WarcWriter
Parameters:
record - WARC record to output
Throws:
IOException - if an exception occurs while writing header data

streamPayload

public long streamPayload(InputStream in)
                   throws IOException
Overrides:
streamPayload in class WarcWriter
Parameters:
in - input stream containing payload data
Returns:
written length of payload data
Throws:
IOException - if an exception occurs while writing payload data

writePayload

public long writePayload(byte[] b)
                  throws IOException
Overrides:
writePayload in class WarcWriter
Throws:
IOException

writePayload

public long writePayload(byte[] b,
                         int offset,
                         int len)
                  throws IOException
Overrides:
writePayload in class WarcWriter
Throws:
IOException


Copyright © 2011-2012. All Rights Reserved.