public class

SimpleOutputBuffer

extends ExpandableBuffer
implements ContentOutputBuffer
java.lang.Object
   ↳ org.apache.http.nio.util.ExpandableBuffer
     ↳ org.apache.http.nio.util.SimpleOutputBuffer

Class Overview

Basic implementation of the ContentOutputBuffer interface.

This class is not thread safe.

Summary

[Expand]
Inherited Constants
From class org.apache.http.nio.util.ExpandableBuffer
[Expand]
Inherited Fields
From class org.apache.http.nio.util.ExpandableBuffer
Public Constructors
SimpleOutputBuffer(int buffersize, ByteBufferAllocator allocator)
Public Methods
void flush()
int produceContent(ContentEncoder encoder)
Writes content from this buffer to the given ContentEncoder.
void reset()
Resets the buffer by clearing its state and stored content.
void shutdown()
void write(byte[] b, int off, int len)
Writes len bytes from the specified byte array starting at offset off to this buffer.
void write(byte[] b)
void write(int b)
Writes the specified byte to this buffer.
void writeCompleted()
Indicates the content has been fully written.
[Expand]
Inherited Methods
From class org.apache.http.nio.util.ExpandableBuffer
From class java.lang.Object
From interface org.apache.http.io.BufferInfo
From interface org.apache.http.nio.util.BufferInfo
From interface org.apache.http.nio.util.ContentOutputBuffer

Public Constructors

public SimpleOutputBuffer (int buffersize, ByteBufferAllocator allocator)

Public Methods

public void flush ()

public int produceContent (ContentEncoder encoder)

Writes content from this buffer to the given ContentEncoder.

Parameters
encoder content encoder.
Returns
  • number of bytes written.
Throws
IOException

public void reset ()

Resets the buffer by clearing its state and stored content.

public void shutdown ()

public void write (byte[] b, int off, int len)

Writes len bytes from the specified byte array starting at offset off to this buffer.

If off is negative, or len is negative, or off+len is greater than the length of the array b, this method can throw a runtime exception. The exact type of runtime exception thrown by this method depends on implementation.

Parameters
b the data.
off the start offset in the data.
len the number of bytes to write.
Throws
IOException

public void write (byte[] b)

Throws
IOException

public void write (int b)

Writes the specified byte to this buffer.

Parameters
b the byte.
Throws
IOException

public void writeCompleted ()

Indicates the content has been fully written.