org.elasticsearch.rest
Class BytesRestResponse

java.lang.Object
  extended by org.elasticsearch.rest.AbstractRestResponse
      extended by org.elasticsearch.rest.BytesRestResponse
All Implemented Interfaces:
RestResponse

public class BytesRestResponse
extends AbstractRestResponse


Constructor Summary
BytesRestResponse(byte[] bytes, String contentType)
           
 
Method Summary
 byte[] content()
          Returns the actual content.
 int contentLength()
          The content length.
 boolean contentThreadSafe()
          Can the content byte[] be used only with this thread (false), or by any thread (true).
 String contentType()
           
 RestStatus status()
           
 
Methods inherited from class org.elasticsearch.rest.AbstractRestResponse
prefixContent, prefixContentLength, suffixContent, suffixContentLength
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BytesRestResponse

public BytesRestResponse(byte[] bytes,
                         String contentType)
Method Detail

contentThreadSafe

public boolean contentThreadSafe()
Description copied from interface: RestResponse
Can the content byte[] be used only with this thread (false), or by any thread (true).


contentType

public String contentType()

content

public byte[] content()
               throws IOException
Description copied from interface: RestResponse
Returns the actual content. Note, use RestResponse.contentLength() in order to know the content length of the byte array.

Throws:
IOException

contentLength

public int contentLength()
                  throws IOException
Description copied from interface: RestResponse
The content length.

Throws:
IOException

status

public RestStatus status()


Copyright © 2009-2012. All Rights Reserved.