public interface

LongString

com.rabbitmq.client.LongString

Class Overview

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.

Summary

Constants
long MAX_LENGTH
Public Methods
abstract byte[] getBytes()
Get the content as a byte array.
abstract DataInputStream getStream()
Get the content stream.
abstract long length()

Constants

public static final long MAX_LENGTH

Constant Value: 4294967295 (0x00000000ffffffff)

Public Methods

public abstract 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 the LongString. Repeated calls to this function may return the same array. This function will fail if this.length() > Integer.MAX_VALUE, throwing an IllegalStateException.

Returns
  • the array of bytes containing the content of the LongString

public abstract DataInputStream 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

public abstract long length ()

Returns
  • the length of the LongString in bytes >= 0 <= MAX_LENGTH