Package com.levigo.jadice.server.util
Class DynamicPipe
- java.lang.Object
-
- java.io.OutputStream
-
- com.levigo.jadice.server.util.DynamicPipe
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class DynamicPipe extends OutputStream
A pipe implementation similar to thePipedInputStream/PipedOutputStreamcombo, but with an unlimited buffer capacity.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDynamicPipe.PipeInputStreamThe output end of the pipe.
-
Field Summary
Fields Modifier and Type Field Description static intBUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description DynamicPipe()Create a dynamic pipe.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()InputStreamgetReadEnd()voidpropagateException(IOException ioException)Propagates an IOException to the reading site.voidwrite(byte[] b, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
-
-
-
Field Detail
-
BUFFER_SIZE
public static final int BUFFER_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DynamicPipe
public DynamicPipe()
Create a dynamic pipe. It acts as the input side (OutputStream) itself. UsegetReadEnd()to retrieve the output side.
-
-
Method Detail
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
getReadEnd
public InputStream getReadEnd()
- Returns:
- the read end (
InputStream) of the pipe.
-
propagateException
public void propagateException(IOException ioException) throws IOException
Propagates an IOException to the reading site.- Parameters:
ioException-exceptionto propagate- Throws:
IOException- if an I/O Error occurs- Since:
- jadice server 4.3.1.0
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
-