com.twelvemonkeys.io.enc
Class EncoderStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.twelvemonkeys.io.enc.EncoderStream
- All Implemented Interfaces:
- Closeable, Flushable
public final class EncoderStream
- extends FilterOutputStream
An OutputStream that provides on-the-fly encoding to an underlying
stream.
- Version:
- $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/enc/EncoderStream.java#2 $
- Author:
- Harald Kuhr
- See Also:
DecoderStream,
Encoder
|
Constructor Summary |
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. |
|
Method Summary |
void |
close()
|
void |
flush()
|
void |
write(byte[] pBytes)
|
void |
write(byte[] pBytes,
int pOffset,
int pLength)
|
void |
write(int pByte)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
encoder
protected final Encoder encoder
buffer
protected final ByteBuffer buffer
EncoderStream
public EncoderStream(OutputStream pStream,
Encoder pEncoder)
- Creates an output stream filter built on top of the specified
underlying output stream.
- Parameters:
pStream - the underlying output streampEncoder - the encoder to use
EncoderStream
public EncoderStream(OutputStream pStream,
Encoder pEncoder,
boolean pFlushOnWrite)
- Creates an output stream filter built on top of the specified
underlying output stream.
- Parameters:
pStream - the underlying output streampEncoder - the encoder to usepFlushOnWrite - if true, calls to the byte-array
write methods will automatically flush the buffer.
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Overrides:
close in class FilterOutputStream
- Throws:
IOException
flush
public void flush()
throws IOException
- Specified by:
flush in interface Flushable- Overrides:
flush in class FilterOutputStream
- Throws:
IOException
write
public final void write(byte[] pBytes)
throws IOException
- Overrides:
write in class FilterOutputStream
- Throws:
IOException
write
public void write(byte[] pBytes,
int pOffset,
int pLength)
throws IOException
- Overrides:
write in class FilterOutputStream
- Throws:
IOException
write
public void write(int pByte)
throws IOException
- Overrides:
write in class FilterOutputStream
- Throws:
IOException
Copyright © 2015. All Rights Reserved.