public class Pipe
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_TIME_OUT_VALUE |
Constructor and Description |
---|
Pipe(ControlledByteBuffer buffer,
java.lang.String name,
BaseConfiguration baseConfig) |
Pipe(org.apache.http.nio.IOControl producerIoControl,
ControlledByteBuffer buffer,
java.lang.String name,
BaseConfiguration baseConfig) |
Modifier and Type | Method and Description |
---|---|
void |
attachConsumer(org.apache.http.nio.IOControl consumerIoControl)
Set the consumers IOControl
|
int |
consume(org.apache.http.nio.ContentEncoder encoder)
Consume the data from the buffer.
|
void |
consumerError() |
java.nio.ByteBuffer |
copyAndConsume(org.apache.http.nio.ContentEncoder encoder)
Consume the data from the buffer.
|
java.nio.ByteBuffer |
copyAndProduce(org.apache.http.nio.ContentDecoder decoder)
Same as
produce(org.apache.http.nio.ContentDecoder) and gives a copy of data produced |
void |
forceProducerComplete(org.apache.http.nio.ContentDecoder decoder)
Helper method to mark as producer completed.
|
void |
forceSetSerializationRest() |
ControlledByteBuffer |
getBuffer() |
java.io.InputStream |
getInputStream()
Creates an InputStream object on the underlying ByteBuffer.
|
java.io.OutputStream |
getOutputStream()
Creates a separate ByteBuffer for the output data and returns an OutputStream
on top of it.
|
boolean |
hasHttpProducer() |
boolean |
isConsumeRequired()
This method returns whether buffer consumption is required or not.
|
boolean |
isDiscardable() |
boolean |
isProducerCompleted() |
boolean |
isProducerError()
Checks the state of the producerError property
|
boolean |
isSerializationComplete() |
int |
produce(org.apache.http.nio.ContentDecoder decoder)
Produce data in to the buffer.
|
void |
producerError() |
java.io.OutputStream |
resetOutputStream()
Creates a separate ByteBuffer for the output data and returns an OutputStream
on top of it.
|
void |
setDiscardable(boolean discardable) |
void |
setRawSerializationComplete(boolean rawSerializationComplete) |
void |
setSerializationComplete(boolean serializationComplete) |
java.lang.String |
toString() |
public static final int DEFAULT_TIME_OUT_VALUE
public Pipe(org.apache.http.nio.IOControl producerIoControl, ControlledByteBuffer buffer, java.lang.String name, BaseConfiguration baseConfig)
public Pipe(ControlledByteBuffer buffer, java.lang.String name, BaseConfiguration baseConfig)
public boolean isProducerCompleted()
public void attachConsumer(org.apache.http.nio.IOControl consumerIoControl)
consumerIoControl
- IOControl of the consumerpublic int consume(org.apache.http.nio.ContentEncoder encoder) throws java.io.IOException
encoder
- encoder used to write the data means there will not be any data
written in to this bufferjava.io.IOException
- if an error occurred while consuming datapublic java.nio.ByteBuffer copyAndConsume(org.apache.http.nio.ContentEncoder encoder) throws java.io.IOException
consume(org.apache.http.nio.ContentEncoder)
but this gives
a copy of data which has been consumed.encoder
- encoder used to writejava.io.IOException
- if an error occurred while consuming datapublic int produce(org.apache.http.nio.ContentDecoder decoder) throws java.io.IOException
decoder
- decoder to read bytes from the underlying streamjava.io.IOException
- if an error occurs while reading datapublic java.nio.ByteBuffer copyAndProduce(org.apache.http.nio.ContentDecoder decoder) throws java.io.IOException
produce(org.apache.http.nio.ContentDecoder)
and gives a copy of data produceddecoder
- decoder to read bytes from the underlying streamjava.io.IOException
- if an error occurs while reading datapublic void forceProducerComplete(org.apache.http.nio.ContentDecoder decoder)
decoder
- decoder instance to consume inputpublic java.lang.String toString()
toString
in class java.lang.Object
public void consumerError()
public void producerError()
public java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
public java.io.OutputStream resetOutputStream()
public void setSerializationComplete(boolean serializationComplete)
public void setRawSerializationComplete(boolean rawSerializationComplete)
public void forceSetSerializationRest()
public boolean isSerializationComplete()
public ControlledByteBuffer getBuffer()
public boolean hasHttpProducer()
public boolean isDiscardable()
public void setDiscardable(boolean discardable)
public boolean isConsumeRequired() throws java.io.IOException
java.io.IOException
public boolean isProducerError()
Copyright © 2005-2021 Apache Software Foundation. All Rights Reserved.