Package org.eclipse.net4j.buffer
Class BufferOutputStream
java.lang.Object
java.io.OutputStream
org.eclipse.net4j.buffer.BufferOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
- Direct Known Subclasses:
ChannelOutputStream
An
output stream that fragments the written byte sequence into fixed-sized buffers and passes them to configured buffer handler.- Author:
- Eike Stepper
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBufferOutputStream(IBufferHandler bufferHandler, short channelID) BufferOutputStream(IBufferHandler bufferHandler, IBufferProvider bufferProvider, short channelID) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidEnsures that this BufferOutputStream has a buffer.voidflush()Flushes the current buffer, it's handled over to the buffer handler.voidvoidflushWithEOS(boolean ccam) getError()protected booleanvoidtoString()voidwrite(byte[] b, int off, int len) voidwrite(int b) Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Field Details
-
DEFAULT_PROPAGATE_CLOSE
public static final boolean DEFAULT_PROPAGATE_CLOSE- See Also:
-
-
Constructor Details
-
BufferOutputStream
public BufferOutputStream(IBufferHandler bufferHandler, IBufferProvider bufferProvider, short channelID) -
BufferOutputStream
-
-
Method Details
-
getError
- Since:
- 2.0
-
setError
- Since:
- 2.0
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
Flushes the current buffer, it's handled over to the buffer handler.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException- Signals that an I/O exception has occurred.- See Also:
-
currentBufferIBufferHandler.handleBuffer(IBuffer)
-
flushWithEOS
- Throws:
IOException
-
flushWithEOS
- Throws:
IOException- Since:
- 4.4
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
toString
-
ensureBuffer
Ensures that this BufferOutputStream has a buffer. If the current buffer was flushed a new one is fetched from the buffer provider.- Throws:
IOException- Signals that an I/O exception has occurred.- See Also:
-
isPropagateClose
protected boolean isPropagateClose()
-