## org.h2.store
Class PageStreamTrunk

    java.lang.Object
      org.h2.util.CacheObject
          org.h2.store.Record
              org.h2.store.Page
                  org.h2.store.PageStreamTrunk

    public class PageStreamTrunk

extends Page

A trunk page of a stream. It contains the page numbers of the stream, and the page number of the next trunk. The format is:

- page type: byte (0)
- checksum: short (1-2)
- previous trunk page, or 0 if none: int (3-6)
- log key: int (7-10)
- next trunk page: int (11-14)
- number of pages: short (15-16)
- page ids (17-)

Field Summary

Fields inherited from class org.h2.store.Page
`changeCount, FLAG_LAST, TYPE_BTREE_LEAF, TYPE_BTREE_NODE, TYPE_DATA_LEAF, TYPE_DATA_NODE, TYPE_DATA_OVERFLOW, TYPE_EMPTY, TYPE_FREE_LIST, TYPE_STREAM_DATA, TYPE_STREAM_TRUNK`

Fields inherited from class org.h2.util.CacheObject
`blockCount, cacheChained, cacheNext, cachePrevious, cacheQueue`

Method Summary
`boolean` `canRemove()` Check if the object can be removed from the cache.
`int` `getByteCount(DataPage dummy)` Get the number of bytes required for the data if the given data page would be used.
`int` `getMemorySize()` Get the estimated memory size.
`int` `getNextTrunk()`
`void` `moveTo(Session session, int newPos)` Copy the data to a new location, change the parent to point to the new location, and free up the current page.
`void` `write(DataPage buff)` Write the record to the data page.

Methods inherited from class org.h2.store.Record
`commit, getSessionId, getStorageId, isDeleted, isEmpty, isLogWritten, prepareWrite, setDeleted, setLastLog, setLogWritten, setSessionId, setStorageId`

Methods inherited from class org.h2.util.CacheObject
`getBlockCount, getPos, isChanged, isPinned, setBlockCount, setChanged, setPos, sort`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getByteCount

    public int getByteCount(DataPage dummy)

  Description copied from class: `Record`
  Get the number of bytes required for the data if the given data page would be used.

  Specified by:
    `getByteCount` in class `Record`
  Parameters:
    `dummy` - the template data page
  Returns:
    the number of bytes

### write

    public void write(DataPage buff)
               throws java.sql.SQLException

  Description copied from class: `Record`
  Write the record to the data page.

  Specified by:
    `write` in class `Record`
  Parameters:
    `buff` - the data page
  Throws:
    `java.sql.SQLException`

### getMemorySize

    public int getMemorySize()

  Get the estimated memory size.

  Overrides:
    `getMemorySize` in class `CacheObject`
  Returns:
    number of double words (4 bytes)

### moveTo

    public void moveTo(Session session,
                       int newPos)

  Description copied from class: `Page`
  Copy the data to a new location, change the parent to point to the new location, and free up the current page.

  Specified by:
    `moveTo` in class `Page`
  Parameters:
    `session` - the session
    `newPos` - the new position

### getNextTrunk

    public int getNextTrunk()

### canRemove

    public boolean canRemove()

  Description copied from class: `CacheObject`
  Check if the object can be removed from the cache. For example pinned objects can not be removed.

  Overrides:
    `canRemove` in class `Record`
  Returns:
    true if it can be removed