io.keen.client.java.http
Interface OutputSource


public interface OutputSource

Interface to allow writing to an OutputStream - in particular the output stream of an HTTP request - directly from a source. This avoids having to write into a buffer, pass the buffer to the request handler, and then have the handler copy the buffer to the connection's output stream.

Since:
2.0.0

Method Summary
 void writeTo(java.io.OutputStream out)
          Writes data to the given OutputStream.
 

Method Detail

writeTo

void writeTo(java.io.OutputStream out)
             throws java.io.IOException
Writes data to the given OutputStream. This method is used to send the body of an HTTP request.

Implementers of this method should NOT close out; the calling code will ensure that it is closed.

Parameters:
out - The OutputStream to which the request body should be written.
Throws:
java.io.IOException - Implementers may throw an IOException if an error is encountered while writing.