## com.sun.jersey.api.client
Interface RequestWriter.RequestEntityWriterListener

Enclosing class:
  RequestWriter

    protected static interface RequestWriter.RequestEntityWriterListener

A lister for listening to events when writing a request entity.

The listener is registered when invoking the `TerminatingClientHandler#writeRequestEntity(com.sun.jersey.api.client.ClientRequest, com.sun.jersey.api.client.TerminatingClientHandler.RequestEntityWriterListener)` method.

Author:
  Paul.Sandoz@Sun.Com

Method Summary
`java.io.OutputStream` | `onGetOutputStream()` Called when the output stream is required to write the request entity.
`void` | `onRequestEntitySize(long size)` Called when the size of the request entity is obtained.

Method Detail

### onRequestEntitySize

    void onRequestEntitySize(long size)
                             throws java.io.IOException

  Called when the size of the request entity is obtained.

  Enables the appropriate setting of HTTP headers for the size of the request entity and/or configure an appropriate transport encoding.

  Parameters:
    `size` - the size, in bytes, of the request entity, otherwise -1 if the size cannot be determined before serialization.
  Throws:
    `java.io.IOException`

### onGetOutputStream

    java.io.OutputStream onGetOutputStream()
                                           throws java.io.IOException

  Called when the output stream is required to write the request entity.

  Returns:
    the output stream to write the request entity.
  Throws:
    `java.io.IOException`

Copyright © 2017 Oracle Corporation. All Rights Reserved.