WiredTiger: com.wiredtiger.db.PackOutputStream 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.PackOutputStream Class Reference

## Public Member Functions
| PackOutputStream (String format)
| PackOutputStream (String format, boolean isRaw)
String | getFormat ()
byte [] | getValue ()
void | reset ()
void | addByte (byte value) throws WiredTigerPackingException
void | addByteArray (byte[] value) throws WiredTigerPackingException
void | addByteArray (byte[] value, int off, int len) throws WiredTigerPackingException
void | addInt (int value) throws WiredTigerPackingException
void | addLong (long value) throws WiredTigerPackingException
void | addRecord (long value) throws WiredTigerPackingException
void | addShort (short value) throws WiredTigerPackingException
void | addString (String value) throws WiredTigerPackingException

## Protected Attributes
PackFormatInputStream | format
ByteArrayOutputStream | packed
byte [] | intBuf
boolean | isRaw

## Detailed Description

An internal helper class for encoding WiredTiger packed values.

Applications should not need to use this class.

## Constructor & Destructor Documentation

## ◆ PackOutputStream() [1/2]

com.wiredtiger.db.PackOutputStream.PackOutputStream | ( | String | format | ) |

Constructor.

Parameters

  format | A String that contains the WiredTiger format that defines the layout of this packed value.

## ◆ PackOutputStream() [2/2]

com.wiredtiger.db.PackOutputStream.PackOutputStream | ( | String | format,
|  | boolean | isRaw
| ) |  |

Constructor.

Parameters

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

## Member Function Documentation

## ◆ addByte()

void com.wiredtiger.db.PackOutputStream.addByte | ( | byte | value | ) | throws WiredTigerPackingException

Add a byte field to the stream.

Parameters

  value | The byte value to be added.

## ◆ addByteArray() [1/2]

void com.wiredtiger.db.PackOutputStream.addByteArray | ( | byte [] | value | ) | throws WiredTigerPackingException

Add a byte array field to the stream.

Parameters

  value | The byte array value to be added.

## ◆ addByteArray() [2/2]

void com.wiredtiger.db.PackOutputStream.addByteArray | ( | byte [] | value,
|  | int | off,
|  | int | len
| ) |  | throws WiredTigerPackingException

Add a byte array field to the stream.

Parameters

  value | The byte array value to be added.
  off | The offset from the start of value to begin using the array.
  len | The length of the value to encode.

## ◆ addInt()

void com.wiredtiger.db.PackOutputStream.addInt | ( | int | value | ) | throws WiredTigerPackingException

Add an integer field to the stream.

Parameters

  value | The integer value to be added.

## ◆ addLong()

void com.wiredtiger.db.PackOutputStream.addLong | ( | long | value | ) | throws WiredTigerPackingException

Add a long field to the stream.

Parameters

  value | The long value to be added.

## ◆ addRecord()

void com.wiredtiger.db.PackOutputStream.addRecord | ( | long | value | ) | throws WiredTigerPackingException

Add a record field to the stream.

Parameters

  value | The record value to be added.

## ◆ addShort()

void com.wiredtiger.db.PackOutputStream.addShort | ( | short | value | ) | throws WiredTigerPackingException

Add a short field to the stream.

Parameters

  value | The short value to be added.

## ◆ addString()

void com.wiredtiger.db.PackOutputStream.addString | ( | String | value | ) | throws WiredTigerPackingException

Add a string field to the stream.

Parameters

  value | The string value to be added.

## ◆ getFormat()

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

Returns the raw packing format string.

## ◆ getValue()

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

Returns the current packed value.

## ◆ reset()

void com.wiredtiger.db.PackOutputStream.reset | ( |  | ) |

Reset the stream position.