com.rabbitmq.client.impl
Interface LongString

All Known Implementing Classes:
LongStringHelper.ByteArrayLongString

public interface LongString

An object providing access to a LongString. This might be implemented to read directly from connection socket, depending on the size of the content to be read - long strings may contain up to 4Gb of content.


Field Summary
static long MAX_LENGTH
           
 
Method Summary
 byte[] getBytes()
          Get the content as a byte array.
 java.io.DataInputStream getStream()
          Get the content stream.
 long length()
          Get the length of the content of the long string in bytes
 

Field Detail

MAX_LENGTH

static final long MAX_LENGTH
See Also:
Constant Field Values
Method Detail

length

long length()
Get the length of the content of the long string in bytes

Returns:
the length in bytes >= 0 <= MAX_LENGTH

getStream

java.io.DataInputStream getStream()
                                  throws java.io.IOException
Get the content stream. Repeated calls to this function return the same stream, which may not support rewind.

Returns:
An input stream the reads the content
Throws:
java.io.IOException - if an error is encountered

getBytes

byte[] getBytes()
Get the content as a byte array. Repeated calls to this function return the same array. This function will fail if getContentLength() > Integer.MAX_VALUE throwing an IllegalStateException.

Returns:
the content as an array