org.apache.commons.httpclient.methods
Class ByteArrayRequestEntity
java.lang.Object
org.apache.commons.httpclient.methods.ByteArrayRequestEntity
- RequestEntity
public class ByteArrayRequestEntity
extends java.lang.Object
A RequestEntity that contains an array of bytes.
ByteArrayRequestEntity
public ByteArrayRequestEntity(byte[] content)
Creates a new entity with the given content.
content
- The content to set.
ByteArrayRequestEntity
public ByteArrayRequestEntity(byte[] content,
String contentType)
Creates a new entity with the given content and content type.
content
- The content to set.contentType
- The content type to set or null
.
getContent
public byte[] getContent()
getContentType
public String getContentType()
Gets the entity's content type. This content type will be used as the value for the
"Content-Type" header.
- getContentType in interface RequestEntity
- the entity's content type
writeRequest
public void writeRequest(OutputStream out)
throws IOException
Writes the request entity to the given stream.
- writeRequest in interface RequestEntity
Copyright (c) 1999-2005 - Apache Software Foundation