Package org.eclipse.jetty.io
Class ByteBufferOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.eclipse.jetty.io.ByteBufferOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class ByteBufferOutputStream extends java.io.OutputStream
Simple wrapper of a ByteBuffer as an OutputStream. The buffer does not grow and this class will throw anBufferOverflowException
if the buffer capacity is exceeded.
-
-
Constructor Summary
Constructors Constructor Description ByteBufferOutputStream(java.nio.ByteBuffer buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
void
write(byte[] b)
void
write(byte[] b, int off, int len)
void
write(int b)
-
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.OutputStream
-
flush
public void flush()
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
-
write
public void write(byte[] b)
- Overrides:
write
in classjava.io.OutputStream
-
write
public void write(byte[] b, int off, int len)
- Overrides:
write
in classjava.io.OutputStream
-
write
public void write(int b)
- Specified by:
write
in classjava.io.OutputStream
-
-