Closeable
, Flushable
, AutoCloseable
public 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 AutoCloseable
close
in interface Closeable
close
in class FilterOutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class FilterOutputStream
IOException
public final void write(byte[] pBytes) throws IOException
write
in class FilterOutputStream
IOException
public void write(byte[] pBytes, int pOffset, int pLength) throws IOException
write
in class FilterOutputStream
IOException
public void write(int pByte) throws IOException
write
in class FilterOutputStream
IOException
Copyright © 2018. All rights reserved.