org.glassfish.jersey.message
Interface MessageBodyWorkers.MessageBodySizeCallback

Enclosing interface:
MessageBodyWorkers

public static interface MessageBodyWorkers.MessageBodySizeCallback

Callback which will be used to pass back the size of the entity. It will be invoked in method MessageBodyWorkers.writeTo(Object, GenericType, Annotation[], MediaType, MultivaluedMap, Map, OutputStream, MessageBodySizeCallback, boolean) and MessageBodyWorkers.writeTo(Object, GenericType, Annotation[], MediaType, MultivaluedMap, Map, OutputStream, MessageBodySizeCallback, boolean, boolean) after selection of the message body writer and before writing to the output stream.


Method Summary
 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 - Size in bytes of the request entity, otherwise -1 if the size cannot be determined before serialization.
Throws:
java.io.IOException - When IO operations fail


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.