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
/PipedOutputStream
combo, but with an unlimited buffer capacity.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DynamicPipe.PipeInputStream
The output end of the pipe.
-
Field Summary
Fields Modifier and Type Field Description static int
BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description DynamicPipe()
Create a dynamic pipe.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
InputStream
getReadEnd()
void
propagateException(IOException ioException)
Propagates an IOException to the reading site.void
write(byte[] b, int off, int len)
void
write(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:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException
- Overrides:
write
in 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
-exception
to propagate- Throws:
IOException
- if an I/O Error occurs- Since:
- jadice server 4.3.1.0
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
-