Package hudson.util
Class HeadBufferingStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
hudson.util.HeadBufferingStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
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
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
-
Method Summary
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
HeadBufferingStream
-
-
Method Details
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
fillSide
Read until we fill up the side buffer.- Throws:
IOException
-
getSideBuffer
public byte[] getSideBuffer()Gets the side buffer content.
-