Top Description Fields Constructors Methods
org.apache.http.impl.entity

public Class EntitySerializer

extends Object
Class Inheritance
Annotations
@Contract
threading:IMMUTABLE_CONDITIONAL
@Deprecated
Imports
java.io.IOException, .OutputStream, org.apache.http.HttpEntity, .HttpException, .HttpMessage, org.apache.http.annotation.ThreadingBehavior, .Contract, org.apache.http.entity.ContentLengthStrategy, org.apache.http.impl.io.ChunkedOutputStream, .ContentLengthOutputStream, .IdentityOutputStream, org.apache.http.io.SessionOutputBuffer, org.apache.http.util.Args

Deprecated

(4.3) use org.apache.http.impl.BHttpConnectionBase

HTTP entity serializer.

This entity serializer currently supports "chunked" and "identitiy" transfer-coding and content length delimited content.

This class relies on a specific implementation of ContentLengthStrategy to determine the content length or transfer encoding of the entity.

This class writes out the content of HttpEntity to the data stream using a transfer coding based on properties on the HTTP message.

Since
4.0

Field Summary

Modifier and TypeField and Description
private final ContentLengthStrategy

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected OutputStream

Returns:

output stream.
doSerialize
(final SessionOutputBuffer
the session output buffer.
outbuffer
,
final HttpMessage
the HTTP message.
message
)

Creates a transfer codec based on properties of the given HTTP message and returns OutputStream instance that transparently encodes output data as it is being written out to the output stream.

public void
serialize(final SessionOutputBuffer
the output session buffer.
outbuffer
,
final HttpMessage
the HTTP message.
message
,
final HttpEntity
the HTTP entity to be written out.
entity
)

Writes out the content of the given HTTP entity to the session output buffer based on properties of the given HTTP message.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lenStrategyback to summary
private final ContentLengthStrategy lenStrategy

Constructor Detail

EntitySerializerback to summary
public EntitySerializer(final ContentLengthStrategy lenStrategy)

Method Detail

doSerializeback to summary
protected OutputStream doSerialize(final SessionOutputBuffer outbuffer, final HttpMessage message) throws HttpException, IOException

Creates a transfer codec based on properties of the given HTTP message and returns OutputStream instance that transparently encodes output data as it is being written out to the output stream.

This method is called by the public serialize(SessionOutputBuffer, HttpMessage, HttpEntity).

Parameters
outbuffer:SessionOutputBuffer

the session output buffer.

message:HttpMessage

the HTTP message.

Returns:OutputStream

output stream.

Exceptions
HttpException:
in case of HTTP protocol violation.
IOException:
in case of an I/O error.
serializeback to summary
public void serialize(final SessionOutputBuffer outbuffer, final HttpMessage message, final HttpEntity entity) throws HttpException, IOException

Writes out the content of the given HTTP entity to the session output buffer based on properties of the given HTTP message.

Parameters
outbuffer:SessionOutputBuffer

the output session buffer.

message:HttpMessage

the HTTP message.

entity:HttpEntity

the HTTP entity to be written out.

Exceptions
HttpException:
in case of HTTP protocol violation.
IOException:
in case of an I/O error.