Package org.apache.http.nio.util
Interface ContentOutputBuffer
- All Known Implementing Classes:
SharedOutputBuffer,SimpleOutputBuffer
public interface ContentOutputBuffer
Generic content output buffer.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidflush()Deprecated.(4.2) No longer used.intproduceContent(ContentEncoder encoder) Deprecated.(4.3) use implementation specific methods.voidreset()Resets the buffer by clearing its state and stored content.voidwrite(byte[] b, int off, int len) Writeslenbytes from the specified byte array starting at offsetoffto this buffer.voidwrite(int b) Writes the specified byte to this buffer.voidIndicates the content has been fully written.
-
Method Details
-
produceContent
Deprecated.(4.3) use implementation specific methods.Writes content from this buffer to the givenContentEncoder.- Parameters:
encoder- content encoder.- Returns:
- number of bytes written.
- Throws:
IOException- in case of an I/O error.
-
reset
void reset()Resets the buffer by clearing its state and stored content. -
flush
Deprecated.(4.2) No longer used.- Throws:
IOException
-
write
Writeslenbytes from the specified byte array starting at offsetoffto this buffer.If
offis negative, orlenis negative, oroff+lenis greater than the length of the arrayb, 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- if an I/O error occurs.
-
write
Writes the specified byte to this buffer.- Parameters:
b- thebyte.- Throws:
IOException- if an I/O error occurs.
-
writeCompleted
Indicates the content has been fully written.- Throws:
IOException- if an I/O error occurs.
-