|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream org.archive.io.SeekInputStream org.archive.io.ReplayInputStream
public class ReplayInputStream
Replays the bytes recorded from a RecordingInputStream or RecordingOutputStream. This InputStream supports mark and reset.
Field Summary | |
---|---|
protected long |
responseBodyStart
Where the response body starts, if marked |
Constructor Summary | |
---|---|
ReplayInputStream(byte[] buffer,
long size,
long responseBodyStart,
java.lang.String backingFilename)
Constructor. |
|
ReplayInputStream(byte[] buffer,
long size,
java.lang.String backingFilename)
Constructor. |
Method Summary | |
---|---|
void |
close()
|
long |
getContentSize()
Total size of content. |
long |
getHeaderSize()
Total size of header. |
long |
getSize()
Total size of stream content. |
long |
position()
|
void |
position(long p)
Reposition the stream. |
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
void |
readContentTo(java.io.OutputStream os)
|
void |
readContentTo(java.io.OutputStream os,
int maxSize)
|
void |
readFullyTo(java.io.OutputStream os)
|
void |
readHeaderTo(java.io.OutputStream os)
|
long |
remaining()
|
long |
setToResponseBodyStart()
|
Methods inherited from class org.archive.io.SeekInputStream |
---|
mark, markSupported, reset |
Methods inherited from class java.io.InputStream |
---|
available, read, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long responseBodyStart
Constructor Detail |
---|
public ReplayInputStream(byte[] buffer, long size, long responseBodyStart, java.lang.String backingFilename) throws java.io.IOException
buffer
- Buffer to read from.size
- Size of data to replay.responseBodyStart
- Start of the response body.backingFilename
- Backing file that sits behind the buffer. If
size > than buffer then we go to backing file to read
data that is beyond buffer.length.
- Throws:
java.io.IOException
- If we fail to open an input stream on
backing file.
public ReplayInputStream(byte[] buffer, long size, java.lang.String backingFilename) throws java.io.IOException
buffer
- Buffer to read from.size
- Size of data to replay.backingFilename
- Backing file that sits behind the buffer. If
size > than buffer then we go to backing file to read
data that is beyond buffer.length.
- Throws:
java.io.IOException
- If we fail to open an input stream on
backing file.
Method Detail |
---|
public long setToResponseBodyStart() throws java.io.IOException
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void readFullyTo(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public void readHeaderTo(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public void readContentTo(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public void readContentTo(java.io.OutputStream os, int maxSize) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
public long getSize()
public long getHeaderSize()
public long getContentSize()
public long remaining()
public void position(long p) throws java.io.IOException
p
- the new position for this stream
java.io.IOException
- if an IO error occurspublic long position() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |