Closeable, Flushable, AutoCloseablepublic final class EncoderStream extends FilterOutputStream
OutputStream that provides on-the-fly encoding to an underlying
stream.
DecoderStream,
Encoder| Modifier and Type | Field | Description |
|---|---|---|
protected ByteBuffer |
buffer |
|
protected Encoder |
encoder |
out| Constructor | Description |
|---|---|
EncoderStream(OutputStream pStream,
Encoder pEncoder) |
Creates an output stream filter built on top of the specified
underlying output stream.
|
EncoderStream(OutputStream pStream,
Encoder pEncoder,
boolean pFlushOnWrite) |
Creates an output stream filter built on top of the specified
underlying output stream.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
void |
flush() |
|
void |
write(byte[] pBytes) |
|
void |
write(byte[] pBytes,
int pOffset,
int pLength) |
|
void |
write(int pByte) |
protected final Encoder encoder
protected final ByteBuffer buffer
public EncoderStream(OutputStream pStream, Encoder pEncoder)
pStream - the underlying output streampEncoder - the encoder to usepublic EncoderStream(OutputStream pStream, Encoder pEncoder, boolean pFlushOnWrite)
pStream - the underlying output streampEncoder - the encoder to usepFlushOnWrite - if true, calls to the byte-array
write methods will automatically flush the buffer.public void close()
throws IOException
close in interface AutoCloseableclose in interface Closeableclose in class FilterOutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class FilterOutputStreamIOExceptionpublic final void write(byte[] pBytes)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void write(byte[] pBytes,
int pOffset,
int pLength)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void write(int pByte)
throws IOException
write in class FilterOutputStreamIOExceptionCopyright © 2018. All rights reserved.