Version 2.0.1
com.wiredtiger.db.PackFormatInputStream Class Reference

An internal helper class for consuming pack format strings. More...

Public Member Functions

String toString ()
 Standard toString - returns the string used during construction.
 
int available ()
 Returns the approximate count of elements left in the format. More...
 
void reset ()
 Reset the current stream position.
 

Protected Member Functions

 PackFormatInputStream (String format)
 Constructor for a format stream. More...
 
char getType () throws WiredTigerPackingException
 Return the decoded type for the next entry in the format stream. More...
 
void checkType (char asking, boolean consume) throws WiredTigerPackingException
 Check to see if the next entry is compatible with the requested type. More...
 
void consume ()
 Move the format stream position ahead one position.
 
int getLengthFromFormat (boolean advance)
 Retrieve a length from the format string. More...
 

Protected Attributes

String format
 
int formatOff
 
int formatRepeatCount
 

Detailed Description

An internal helper class for consuming pack format strings.

Applications should not need to use this class.

Constructor & Destructor Documentation

com.wiredtiger.db.PackFormatInputStream.PackFormatInputStream ( String  format)
protected

Constructor for a format stream.

Parameters
formatthe encoded format backing string.

Member Function Documentation

int com.wiredtiger.db.PackFormatInputStream.available ( )

Returns the approximate count of elements left in the format.

This method does not account for repeat counts or string length encodings - so should be used as a guide only.

void com.wiredtiger.db.PackFormatInputStream.checkType ( char  asking,
boolean  consume 
) throws WiredTigerPackingException
protected

Check to see if the next entry is compatible with the requested type.

Parameters
askingthe format type to match.
consumeindicates whether to update the stream position.
int com.wiredtiger.db.PackFormatInputStream.getLengthFromFormat ( boolean  advance)
protected

Retrieve a length from the format string.

Either for a repeat count or a string length. Return one if no explicit repeat count.

Parameters
advancewhether to move the stream position.
char com.wiredtiger.db.PackFormatInputStream.getType ( ) throws WiredTigerPackingException
protected

Return the decoded type for the next entry in the format stream.

Does not adjust the position of the stream.