PageStreamData

A data page of a stream. The format is:
  • page type: byte (0)
  • checksum: short (1-2)
  • the trunk page id: int (3-6)
  • log key: int (7-10)
  • data (11-)


Methods
static PageStreamData create(PageStore store, int pageId, int trunk, int logKey)
Create a new stream trunk page.
static PageStreamData create(PageStore store, int pageId, int trunk, int logKey)
Create a new stream trunk page.
Parameters:
store - the page store
pageId - the page id
trunk - the trunk page
logKey - the log key
Returns:
the page
static int getCapacity(int pageSize)
Get the number of bytes that fit in a page.
static int getCapacity(int pageSize)
Get the number of bytes that fit in a page.
Parameters:
pageSize - the page size
Returns:
the number of bytes
static int getReadStart()
static int getReadStart()
static PageStreamData read(PageStore store, Data data, int pageId)
Read a stream data page.
static PageStreamData read(PageStore store, Data data, int pageId)
Read a stream data page.
Parameters:
store - the page store
data - the data
pageId - the page id
Returns:
the page
boolean canMove()
boolean canMove()
boolean canRemove()
boolean canRemove()
int getLogKey()
int getLogKey()
int getMemory()
Get the estimated memory size.
int getMemory()
Get the estimated memory size.
Returns:
number of double words (4 bytes)
int getRemaining()
Get the number of remaining data bytes of this page.
int getRemaining()
Get the number of remaining data bytes of this page.
Returns:
the remaining byte count
void initWrite()
Write the header data.
void initWrite()
Write the header data.
void moveTo(Session session, int newPos)
void moveTo(Session session, int newPos)
void read(int startPos, byte[] buff, int off, int len)
Read the next bytes from the buffer.
void read(int startPos, byte[] buff, int off, int len)
Read the next bytes from the buffer.
Parameters:
startPos - the position in the data page
buff - the target buffer
off - the offset in the target buffer
len - the number of bytes to read
String toString()
String toString()
int write(byte[] buff, int offset, int len)
Write the data to the buffer.
int write(byte[] buff, int offset, int len)
Write the data to the buffer.
Parameters:
buff - the source data
offset - the offset in the source buffer
len - the number of bytes to write
Returns:
the number of bytes written
void write()
void write()