Quadcap Embeddable Database

com.quadcap.sql.file.ByteUtil Class Reference

List of all members.

Detailed Description

This class encapsulates various utilities for manipulating byte arrays which contain primitive values, such as integers, strings, etc.

Author:
Stan Bailes

Definition at line 47 of file ByteUtil.java.

Static Public Member Functions

final short getShort (byte[] buf, int pos)
 Get the two-byte short stored at the specified location in the buffer.

final void putShort (byte[] buf, int pos, short val)
 Write an short value as two bytes (MSB first) into the buffer.

final int getInt (byte[] buf, int pos)
 Get the four-byte integer stored at the specified location in the buffer.

final void putInt (byte[] buf, int pos, int val)
 Write an integer value as four bytes (MSB first) into the buffer.

final long getLong (byte[] buf, int pos)
 Get the eight-byte long stored at the specified location in the buffer.

final void putLong (byte[] buf, int pos, long val)
 Write an long value as eight bytes (MSB first) into the buffer.


Member Function Documentation

final int com.quadcap.sql.file.ByteUtil.getInt byte[]  buf,
int  pos
[static]
 

Get the four-byte integer stored at the specified location in the buffer.

Parameters:
buf the buffer from which the integer is read.
pos the position in the buffer.

Definition at line 78 of file ByteUtil.java.

References com.quadcap.sql.file.ByteUtil.getInt().

Referenced by com.quadcap.sql.file.ByteUtil.getInt().

final long com.quadcap.sql.file.ByteUtil.getLong byte[]  buf,
int  pos
[static]
 

Get the eight-byte long stored at the specified location in the buffer.

Parameters:
buf the buffer from which the long is read.
pos the position in the buffer.

Definition at line 107 of file ByteUtil.java.

References com.quadcap.sql.file.ByteUtil.getLong().

Referenced by com.quadcap.sql.file.ByteUtil.getLong().

final short com.quadcap.sql.file.ByteUtil.getShort byte[]  buf,
int  pos
[static]
 

Get the two-byte short stored at the specified location in the buffer.

Parameters:
buf the buffer from which the short is read.
pos the position in the buffer.

Definition at line 55 of file ByteUtil.java.

References com.quadcap.sql.file.ByteUtil.getShort().

Referenced by com.quadcap.sql.file.ByteUtil.getShort().

final void com.quadcap.sql.file.ByteUtil.putInt byte[]  buf,
int  pos,
int  val
[static]
 

Write an integer value as four bytes (MSB first) into the buffer.

Parameters:
buf the buffer
pos the byte offset of the first value
val the value to write to the buffer

Definition at line 93 of file ByteUtil.java.

References com.quadcap.sql.file.ByteUtil.putInt().

Referenced by com.quadcap.sql.file.ByteUtil.putInt().

final void com.quadcap.sql.file.ByteUtil.putLong byte[]  buf,
int  pos,
long  val
[static]
 

Write an long value as eight bytes (MSB first) into the buffer.

Parameters:
buf the buffer
pos the byte offset of the first value
val the value to write to the buffer

Definition at line 126 of file ByteUtil.java.

References com.quadcap.sql.file.ByteUtil.putLong().

Referenced by com.quadcap.sql.file.ByteUtil.putLong().

final void com.quadcap.sql.file.ByteUtil.putShort byte[]  buf,
int  pos,
short  val
[static]
 

Write an short value as two bytes (MSB first) into the buffer.

Parameters:
buf the buffer
pos the byte offset of the first value
val the value to write to the buffer

Definition at line 66 of file ByteUtil.java.

References com.quadcap.sql.file.ByteUtil.putShort().

Referenced by com.quadcap.sql.file.ByteUtil.putShort().