hudson.util
Class HeadBufferingStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
hudson.util.HeadBufferingStream
- All Implemented Interfaces:
- Closeable
public class HeadBufferingStream
- extends FilterInputStream
FilterInputStream
that buffers the first N bytes to a byte array on the side.
This byte array can be then accessed later.
Useful for sniffing the content of the stream after the error is discovered.
- Author:
- Kohsuke Kawaguchi
Method Summary |
void |
fillSide()
Read until we fill up the side buffer. |
byte[] |
getSideBuffer()
Gets the side buffer content. |
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HeadBufferingStream
public HeadBufferingStream(InputStream in,
int sideBufferSize)
read
public int read()
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
fillSide
public void fillSide()
throws IOException
- Read until we fill up the side buffer.
- Throws:
IOException
getSideBuffer
public byte[] getSideBuffer()
- Gets the side buffer content.
Copyright © 2004-2013. All Rights Reserved.