org.apache.commons.httpclient.methods

Class ByteArrayRequestEntity

public class ByteArrayRequestEntity extends Object implements RequestEntity

A RequestEntity that contains an array of bytes.

Since: 3.0

Constructor Summary
ByteArrayRequestEntity(byte[] content)
Creates a new entity with the given content.
ByteArrayRequestEntity(byte[] content, String contentType)
Creates a new entity with the given content and content type.
Method Summary
byte[]getContent()
longgetContentLength()
StringgetContentType()
booleanisRepeatable()
voidwriteRequest(OutputStream out)

Constructor Detail

ByteArrayRequestEntity

public ByteArrayRequestEntity(byte[] content)
Creates a new entity with the given content.

Parameters: content The content to set.

ByteArrayRequestEntity

public ByteArrayRequestEntity(byte[] content, String contentType)
Creates a new entity with the given content and content type.

Parameters: content The content to set. contentType The content type to set or null.

Method Detail

getContent

public byte[] getContent()

Returns: Returns the content.

getContentLength

public long getContentLength()

Returns: The length of the content.

getContentType

public String getContentType()

isRepeatable

public boolean isRepeatable()

Returns: true

writeRequest

public void writeRequest(OutputStream out)
Copyright (c) 1999-2005 - Apache Software Foundation