WiredTiger: com.wiredtiger.db.PackInputStream Class Reference

| Version 3.1.0

Fork me on GitHub Join my user group
List of all members | Public Member Functions | Protected Attributes
com.wiredtiger.db.PackInputStream Class Reference

## Public Member Functions
| PackInputStream (String format, byte[] value)
| PackInputStream (String format, byte[] value, boolean isRaw)
| PackInputStream (String format, byte[] value, boolean isRaw, int off, int len)
String | getFormat ()
byte [] | getValue ()
byte | getByte () throws WiredTigerPackingException
void | getByteArray (byte[] dest) throws WiredTigerPackingException
void | getByteArray (byte[] dest, int off, int len) throws WiredTigerPackingException
byte [] | getByteArray () throws WiredTigerPackingException
int | getInt () throws WiredTigerPackingException
long | getLong () throws WiredTigerPackingException
long | getRecord () throws WiredTigerPackingException
short | getShort () throws WiredTigerPackingException
String | getString () throws WiredTigerPackingException

## Protected Attributes
PackFormatInputStream | format
byte [] | value
int | valueOff
int | valueLen
boolean | isRaw

## Detailed Description

An internal helper class for decoding WiredTiger packed values.

Applications should not need to use this class.

## Constructor & Destructor Documentation

## ◆ PackInputStream() [1/3]

com.wiredtiger.db.PackInputStream.PackInputStream | ( | String | format,
|  | byte [] | value
| ) |  |

Constructor.

Parameters

  format | A String that contains the WiredTiger format that defines the layout of this packed value.
  value | The raw bytes that back the stream.

## ◆ PackInputStream() [2/3]

com.wiredtiger.db.PackInputStream.PackInputStream | ( | String | format,
|  | byte [] | value,
|  | boolean | isRaw
| ) |  |

Constructor.

Parameters

  format | A String that contains the WiredTiger format that defines the layout of this packed value.
  value | The raw bytes that back the stream.
  isRaw | The stream is opened raw.

## ◆ PackInputStream() [3/3]

com.wiredtiger.db.PackInputStream.PackInputStream | ( | String | format,
|  | byte [] | value,
|  | boolean | isRaw,
|  | int | off,
|  | int | len
| ) |  |

Constructor.

Parameters

  format | A String that contains the WiredTiger format that defines the layout of this packed value.
  value | The raw bytes that back the stream.
  isRaw | The stream is opened raw.
  off | Offset into the value array at which the stream begins.
  len | Length of the value array that forms the stream.

## Member Function Documentation

## ◆ getByte()

byte com.wiredtiger.db.PackInputStream.getByte | ( |  | ) | throws WiredTigerPackingException

Retrieves a byte field from the stream.

## ◆ getByteArray() [1/3]

void com.wiredtiger.db.PackInputStream.getByteArray | ( | byte [] | dest | ) | throws WiredTigerPackingException

Retrieves a byte array field from the stream.

Parameters

  dest | The byte array where the returned value will be stored. The array should be large enough to store the entire data item, if it is not, a truncated value will be returned.

## ◆ getByteArray() [2/3]

void com.wiredtiger.db.PackInputStream.getByteArray | ( | byte [] | dest,
|  | int | off,
|  | int | len
| ) |  | throws WiredTigerPackingException

Retrieves a byte array field from the stream.

Parameters

  dest | The byte array where the returned value will be stored.
  off | Offset into the destination buffer to start copying into.
  len | The length should be large enough to store the entire data item, if it is not, a truncated value will be returned.

## ◆ getByteArray() [3/3]

byte [] com.wiredtiger.db.PackInputStream.getByteArray | ( |  | ) | throws WiredTigerPackingException

Retrieves a byte array field from the stream. Creates a new byte array that is the size of the object being retrieved.

## ◆ getFormat()

String com.wiredtiger.db.PackInputStream.getFormat | ( |  | ) |

Returns the raw packing format string.

## ◆ getInt()

int com.wiredtiger.db.PackInputStream.getInt | ( |  | ) | throws WiredTigerPackingException

Retrieves an integer field from the stream.

## ◆ getLong()

long com.wiredtiger.db.PackInputStream.getLong | ( |  | ) | throws WiredTigerPackingException

Retrieves a long field from the stream.

## ◆ getRecord()

long com.wiredtiger.db.PackInputStream.getRecord | ( |  | ) | throws WiredTigerPackingException

Retrieves a record field from the stream.

## ◆ getShort()

short com.wiredtiger.db.PackInputStream.getShort | ( |  | ) | throws WiredTigerPackingException

Retrieves a short field from the stream.

## ◆ getString()

String com.wiredtiger.db.PackInputStream.getString | ( |  | ) | throws WiredTigerPackingException

Retrieves a string field from the stream.

## ◆ getValue()

byte [] com.wiredtiger.db.PackInputStream.getValue | ( |  | ) |

Returns the raw value byte array.