Package org.kohsuke.stapler.framework.io
Class ByteBuffer
- java.lang.Object
-
- java.io.OutputStream
-
- org.kohsuke.stapler.framework.io.ByteBuffer
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class ByteBuffer extends OutputStream
ByteArrayOutputStream
re-implementation.This version allows one to read while writing is in progress.
- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description ByteBuffer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
length()
InputStream
newInputStream()
Creates anInputStream
that reads from the underlying buffer.String
toString()
void
write(byte[] b, int off, int len)
void
write(int b)
void
writeTo(OutputStream os)
Writes the contents of this buffer to another OutputStream.-
Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream, write
-
-
-
-
Method Detail
-
write
public void write(byte[] b, int off, int len) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(int b) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
length
public long length()
-
writeTo
public void writeTo(OutputStream os) throws IOException
Writes the contents of this buffer to another OutputStream.- Throws:
IOException
-
newInputStream
public InputStream newInputStream()
Creates anInputStream
that reads from the underlying buffer.
-
-