@InterfaceAudience.Private public class ByteBufferWriterOutputStream extends OutputStream implements ByteBufferWriter
| Modifier and Type | Field and Description | 
|---|---|
| private byte[] | buf | 
| private int | bufSize | 
| private static int | DEFAULT_BUFFER_SIZE | 
| private OutputStream | os | 
| Constructor and Description | 
|---|
| ByteBufferWriterOutputStream(OutputStream os) | 
| ByteBufferWriterOutputStream(OutputStream os,
                            int size) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close() | 
| void | flush() | 
| void | write(byte[] b,
     int off,
     int len) | 
| void | write(ByteBuffer b,
     int off,
     int len)Writes len bytes from the specified ByteBuffer starting at offset off to this OutputStream. | 
| void | write(int b) | 
| void | writeInt(int i)Writes an  intto the underlying output stream as four bytes, high byte first. | 
writeprivate static final int DEFAULT_BUFFER_SIZE
private final OutputStream os
private final int bufSize
private byte[] buf
public ByteBufferWriterOutputStream(OutputStream os)
public ByteBufferWriterOutputStream(OutputStream os, int size)
public void write(ByteBuffer b, int off, int len) throws IOException
write in interface ByteBufferWriterb - the ByteBufferoff - the start offset in the datalen - the number of bytes to write n * if an I/O error occurs. In particular, an
            IOException is thrown if the output stream is closed.IOException - if an I/O error occurs.public void writeInt(int i) throws IOException
ByteBufferWriterint to the underlying output stream as four bytes, high byte first.writeInt in interface ByteBufferWriteri - the int to writeIOException - if an I/O error occurs.public void write(int b) throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b, int off, int len) throws IOException
write in class OutputStreamIOExceptionpublic void flush() throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close() throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.