FileDocCategorySizeDatePackage
ByteArrayEntity.javaAPI DocAndroid 1.5 API2917Wed May 06 22:41:10 BST 2009org.apache.http.entity

ByteArrayEntity

public class ByteArrayEntity extends AbstractHttpEntity implements Cloneable
An entity whose content is retrieved from a byte array.
author
Oleg Kalnichevski
version
$Revision: 604625 $
since
4.0

Fields Summary
protected final byte[]
content
Constructors Summary
public ByteArrayEntity(byte[] b)

        super();        
        if (b == null) {
            throw new IllegalArgumentException("Source byte array may not be null");
        }
        this.content = b;
    
Methods Summary
public java.lang.Objectclone()

        return super.clone();
    
public java.io.InputStreamgetContent()

        return new ByteArrayInputStream(this.content);
    
public longgetContentLength()

        return this.content.length;
    
public booleanisRepeatable()

        return true;
    
public booleanisStreaming()
Tells that this entity is not streaming.

return
false

        return false;
    
public voidwriteTo(java.io.OutputStream outstream)

        if (outstream == null) {
            throw new IllegalArgumentException("Output stream may not be null");
        }
        outstream.write(this.content);
        outstream.flush();