org.apache.commons.httpclient.methods
Class InputStreamRequestEntity
- RequestEntity
public class InputStreamRequestEntity
A RequestEntity that contains an InputStream.
- 3.0
CONTENT_LENGTH_AUTO
public static final int CONTENT_LENGTH_AUTO
The content length will be calculated automatically. This implies
buffering of the content.
- -2
InputStreamRequestEntity
public InputStreamRequestEntity(InputStream content)
Creates a new InputStreamRequestEntity with the given content and a content type of
CONTENT_LENGTH_AUTO
.
content
- The content to set.
InputStreamRequestEntity
public InputStreamRequestEntity(InputStream content,
String contentType)
Creates a new InputStreamRequestEntity with the given content, content type, and a
content length of
CONTENT_LENGTH_AUTO
.
content
- The content to set.contentType
- The type of the content, or null
.
InputStreamRequestEntity
public InputStreamRequestEntity(InputStream content,
long contentLength)
content
- The content to set.contentLength
- The content size in bytes or any of
InputStreamRequestEntity
public InputStreamRequestEntity(InputStream content,
long contentLength,
String contentType)
content
- The content to set.contentLength
- The content size in bytes or any ofcontentType
- The type of the content, or null
.
getContent
public InputStream getContent()
- Returns the content.
getContentLength
public long getContentLength()
Gets the content length. If the content length has not been set, the content will be
buffered to determine the actual content length.
- getContentLength in interface RequestEntity
writeRequest
public void writeRequest(OutputStream out)
throws IOException
Writes the request entity to the given stream.
- writeRequest in interface RequestEntity
out
-
Copyright (c) 1999-2005 - Apache Software Foundation