Package com.rabbitmq.client
Interface LongString
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
Fields -
Method Summary
-
Field Details
-
MAX_LENGTH
static final long MAX_LENGTH- See Also:
-
-
Method Details
-
length
long length()- Returns:
- the length of the
LongStringin bytes >= 0 invalid input: '<'= MAX_LENGTH
-
getStream
Get the content stream. Repeated calls to this function return the same stream, which may not support rewind.- Returns:
- An input stream that reads the content of the
LongString - Throws:
IOException- if an error is encountered
-
getBytes
byte[] getBytes()Get the content as a byte array. This need not be a copy. Updates to the returned array may change the value of theLongString. Repeated calls to this function may return the same array. This function will fail ifthis.length() > Integer.MAX_VALUE, throwing anIllegalStateException.- Returns:
- the array of bytes containing the content of the
LongString
-
toString
String toString()Get the content as a String. Uses UTF-8 as encoding.- Overrides:
toStringin classObject- Returns:
- he content of the
LongStringas a string
-