Top Description Methods
org.apache.hc.core5.http.nio.support.classic

public Interface ContentOutputBuffer

Known Direct Implementers
org.apache.hc.core5.http.nio.support.classic.SharedOutputBuffer
Imports
java.io.IOException

Generic content output buffer.
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

data length
length
()

Return length data stored in the buffer

public void
reset()

Resets the buffer by clearing its state and stored content.

public void
write(byte[]
the data.
b
,
int
the start offset in the data.
off
,
int
the number of bytes to write.
len
)

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

public void
write(int
the byte.
b
)

Writes the specified byte to this buffer.

public void
writeCompleted()

Indicates the content has been fully written.

Method Detail

lengthback to summary
public int length()

Return length data stored in the buffer

Returns:int

data length

resetback to summary
public void reset()

Resets the buffer by clearing its state and stored content.

writeback to summary
public void write(byte[] b, int off, int len) throws IOException

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:byte[]

the data.

off:int

the start offset in the data.

len:int

the number of bytes to write.

Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public void write(int b) throws IOException

Writes the specified byte to this buffer.

Parameters
b:int

the byte.

Exceptions
IOException:
if an I/O error occurs.
writeCompletedback to summary
public void writeCompleted() throws IOException

Indicates the content has been fully written.

Exceptions
IOException:
if an I/O error occurs.