Package org.forgerock.http.io
Class PipeBufferedStream
- java.lang.Object
-
- org.forgerock.http.io.PipeBufferedStream
-
public final class PipeBufferedStream extends Object
Represents a pipe for transferring bytes from anOutputStream
to aInputStream
. This class is not thread-safe : the buffer has to be fully filled before reading from it : if the consumers reads faster than the producer writes into it, then the consumer will get to the end of the buffer and that will be interpreted an end-of-stream.
-
-
Constructor Summary
Constructors Constructor Description PipeBufferedStream()
Deprecated.Since 25.0.0.PipeBufferedStream(Factory<Buffer> bufferFactory)
Constructs a newPipeBufferedStream
with the givenFactory
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutputStream
getIn()
Returns the output stream which writes to the pipe.InputStream
getOut()
Returns the input stream which reads from the pipe.
-
-
-
Constructor Detail
-
PipeBufferedStream
@Deprecated public PipeBufferedStream()
Deprecated.Since 25.0.0. Prefer usingPipeBufferedStream(Factory)
to provide your own Buffer FactoryConstructs a newPipeBufferedStream
with a defaultFactory
.
-
PipeBufferedStream
public PipeBufferedStream(Factory<Buffer> bufferFactory)
Constructs a newPipeBufferedStream
with the givenFactory
.- Parameters:
bufferFactory
- The factory to use to create the buffer holding the bytes.
-
-
Method Detail
-
getIn
public OutputStream getIn()
Returns the output stream which writes to the pipe.- Returns:
- The output stream.
-
getOut
public InputStream getOut()
Returns the input stream which reads from the pipe.- Returns:
- The input stream.
-
-