Phants Client for Redis™*
Public Member Functions | List of all members
BulkStringSinkAdapter Class Reference
Inheritance diagram for BulkStringSinkAdapter:
Inheritance graph
[legend]
Collaboration diagram for BulkStringSinkAdapter:
Collaboration graph
[legend]

Public Member Functions

 BulkStringSinkAdapter (BulkStringCallback bulkStringCallback, ErrorCallback errorCallback, int bufferSize=BUFFER_SIZE_32K)
 
 BulkStringSinkAdapter (BulkStringCallback bulkStringCallback, ErrorCallback errorCallback, byte[] buffer)
 
void BulkStringBegin (int size)
 
void BulkStringData (byte[] data, int offset, int numBytes)
 
void BulkStringDone ()
 
void Error (string error)
 

Detailed Description

An implementation of the BulkStringSink interface that is designed to handle RESP Bulk Strings.

Constructor & Destructor Documentation

BulkStringSinkAdapter ( BulkStringCallback  bulkStringCallback,
ErrorCallback  errorCallback,
int  bufferSize = BUFFER_SIZE_32K 
)
inline

Constructs a BulkStringSinkAdapter.

Parameters
bulkStringCallbackDelegate method that is called when a RESP Bulk String has been received.
errorCallbackDelegate method that is called when a RESP Error has been received.
bufferSizeAn optional parameter allowing the user to specify how big the receive buffer should be.
BulkStringSinkAdapter ( BulkStringCallback  bulkStringCallback,
ErrorCallback  errorCallback,
byte[]  buffer 
)
inline

Constructs a BulkStringSinkAdapter.

Parameters
bulkStringCallbackDelegate method that is called when a RESP Bulk String has been received.
errorCallbackDelegate method that is called when a RESP Error has been received.
bufferA buffer provided by the user that serves as the Bulk String receive buffer.

Member Function Documentation

void BulkStringBegin ( int  size)
inline

Called at the start of a RESP Bulk String.

Parameters
sizeThe length of the string being parsed.

Implements BulkStringParser.

void BulkStringData ( byte[]  data,
int  offset,
int  numBytes 
)
inline

Called when a block of string data has been read.

Since RESP Bulk Strings can be up to 512MB in length, this interface was designed to handle data in chunks (typically sent over a network). This method will be called as many times is as necessary to transfer the whole Bulk String.

Parameters
dataA buffer containing the block of new bytes.
offsetThe zero-based offset into data where the new bytes are stored.
numBytesThe number of bytes read.

Implements BulkStringParser.

void BulkStringDone ( )
inline

Called after the last byte(s) of a Bulk String have been parsed.

Implements BulkStringParser.

void Error ( string  error)
inline

Called when an Error has been parsed.

Parameters
errorThe error string that was parsed.

Implements ErrorParser.


The documentation for this class was generated from the following file: