Package com.mku.streams
Class BlockingInputOutputAdapterStream
java.lang.Object
java.io.OutputStream
java.io.PipedOutputStream
com.mku.streams.BlockingInputOutputAdapterStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Piped input and outputstream with blocking flush and close.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()Get the input stream attached to this piped streamvoidsetReceived(boolean value) Notify the stream that all the data are consumedvoidwrite(byte[] buffer, int offset, int count) Methods inherited from class java.io.PipedOutputStream
connect, writeMethods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
BlockingInputOutputAdapterStream
Initialize a blocking piped adapter.- Throws:
IOException- If an error occurs
-
-
Method Details
-
getInputStream
Get the input stream attached to this piped stream- Returns:
- The input stream
-
write
- Overrides:
writein classPipedOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classPipedOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classPipedOutputStream- Throws:
IOException
-
setReceived
public void setReceived(boolean value) Notify the stream that all the data are consumed- Parameters:
value- True to notify
-