org.apache.http.entity
Class ByteArrayEntityHC4

java.lang.Object
  extended by org.apache.http.entity.AbstractHttpEntityHC4
      extended by org.apache.http.entity.ByteArrayEntityHC4
All Implemented Interfaces:
java.lang.Cloneable, org.apache.http.HttpEntity

@NotThreadSafe
public class ByteArrayEntityHC4
extends AbstractHttpEntityHC4
implements java.lang.Cloneable

A self contained, repeatable entity that obtains its content from a byte array.

Since:
4.0

Field Summary
protected  byte[] content
          Deprecated. (4.2)
 
Fields inherited from class org.apache.http.entity.AbstractHttpEntityHC4
chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE
 
Constructor Summary
ByteArrayEntityHC4(byte[] b)
           
ByteArrayEntityHC4(byte[] b, ContentType contentType)
           
ByteArrayEntityHC4(byte[] b, int off, int len)
           
ByteArrayEntityHC4(byte[] b, int off, int len, ContentType contentType)
           
 
Method Summary
 java.lang.Object clone()
           
 java.io.InputStream getContent()
           
 long getContentLength()
           
 boolean isRepeatable()
           
 boolean isStreaming()
          Tells that this entity is not streaming.
 void writeTo(java.io.OutputStream outstream)
           
 
Methods inherited from class org.apache.http.entity.AbstractHttpEntityHC4
consumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

content

@Deprecated
protected final byte[] content
Deprecated. (4.2)
Constructor Detail

ByteArrayEntityHC4

public ByteArrayEntityHC4(byte[] b,
                          ContentType contentType)
Since:
4.2

ByteArrayEntityHC4

public ByteArrayEntityHC4(byte[] b,
                          int off,
                          int len,
                          ContentType contentType)
Since:
4.2

ByteArrayEntityHC4

public ByteArrayEntityHC4(byte[] b)

ByteArrayEntityHC4

public ByteArrayEntityHC4(byte[] b,
                          int off,
                          int len)
Method Detail

isRepeatable

public boolean isRepeatable()
Specified by:
isRepeatable in interface org.apache.http.HttpEntity

getContentLength

public long getContentLength()
Specified by:
getContentLength in interface org.apache.http.HttpEntity

getContent

public java.io.InputStream getContent()
Specified by:
getContent in interface org.apache.http.HttpEntity

writeTo

public void writeTo(java.io.OutputStream outstream)
             throws java.io.IOException
Specified by:
writeTo in interface org.apache.http.HttpEntity
Throws:
java.io.IOException

isStreaming

public boolean isStreaming()
Tells that this entity is not streaming.

Specified by:
isStreaming in interface org.apache.http.HttpEntity
Returns:
false

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException