public class ByteBucket extends BaseObject implements ISupportInitialize
Modifier and Type | Field and Description |
---|---|
protected java.util.LinkedList<byte[]> |
buckets
List of rows
|
private int64 |
defaultCapacity
The initial size of the memptrs that are held in the Bucket's array.
|
private static int |
MAX_BYTES_PER_ROW
Bucket row size
|
protected int64 |
position
The current position
|
protected int64 |
size
The bucket size (total number of bytes)
|
private long |
writePosition
The current write position, putBytes always seems to write at the end regardless of position set
|
Constructor and Description |
---|
ByteBucket() |
Modifier and Type | Method and Description |
---|---|
void |
__core_ByteBucket_constructor__()
Constructor.
|
void |
__core_ByteBucket_constructor__(int64 _defaultCapacity)
Constructor.
|
void |
__core_ByteBucket_constructor__(integer _initialSize)
Constructor.
|
void |
__core_ByteBucket_constructor__(integer initialSize,
int64 defaultCapacity)
Constructor.
|
static void |
__core_ByteBucket_constructor__static__()
Constructor.
|
void |
__core_ByteBucket_destructor__()
Destructor for this class.
|
void |
__core_ByteBucket_execute__()
Execute method
|
void |
clear_()
Clears/resets the ByteBucket.
|
void |
debug()
Debug method to dump out current RAW bytes into a file.
|
void |
destroy()
Destroy.
|
integer |
getByte()
Returns a byte at the current position, and increments the position marker.
|
integer |
getByte(int64 _pos)
Returns a byte at the specified position.
|
object<? extends Memptr> |
getBytes()
Returns the entire contents of this bucket as a Memptr instance.
|
object<? extends Memptr> |
getBytes(int64 size)
Returns a Memptr instance containing the specified number of bytes, starting at the
current position.
|
object<? extends Memptr> |
getBytes(int64 _pos,
int64 _size)
Returns a Memptr instance containing the specified number of bytes, starting at the
specified position.
|
int64 |
getDefaultCapacity()
Get the initial size of the memptrs that are held in the Bucket's array.
|
raw |
getHash()
Returns a hash of the current contents of the bucket.
|
raw |
getHash(object<? extends HashAlgorithmEnum> _p1)
Returns a hash of the current contents of the bucket.
|
int64 |
getPosition()
Get the current read position.
|
int64 |
getSize()
Returns the size of the data in the bucket.
|
longchar |
getString()
Returns a string/character representation of the entire set of bytes.
|
longchar |
getString(int64 size)
Returns a string/character representation a particular number of bytes, from the current
position.
|
longchar |
getString(int64 pos,
int64 size)
Returns a string/character representation a particular number of bytes, from a given start
position.
|
longchar |
getString(int64 pos,
int64 size,
character targetCP)
Returns a string/character representation a particular number of bytes, from a given start
position.
|
longchar |
getString(int64 _pos,
int64 _size,
character _sourceCP,
character _targetCP)
Returns a string/character representation a particular number of bytes, from a given start
position.
|
void |
initialize()
Initialize
|
static object<? extends ByteBucket> |
instance()
Factory method for creating a ByteBucket.
|
static object<? extends ByteBucket> |
instance(int64 _p1)
Factory method for creating a ByteBucket.
|
static object<? extends ByteBucket> |
instance(integer _p1,
int64 _p2)
Factory method for creating a ByteBucket.
|
void |
putBytes_1(object<? extends Memptr> _mptr)
Copies all of the bytes from a Memptr instance into this bucket.
|
void |
putBytes(int64 _ptr,
int64 _size)
Copies all of the bytes from a memptr into this bucket.
|
void |
putBytes(memptr _ptr)
Copies all of the bytes from a memptr (primitive) into this bucket.
|
void |
putBytes(object<? extends ByteBucket> _data)
Copies all of the bytes from a ByteBucket instance into this bucket.
|
void |
putString(longchar _data)
Copies all of the bytes from a longchar into this bucket.
|
void |
putString(longchar _data,
character _targetCP)
Copies all of the bytes from a longchar into this bucket.
|
void |
putString(longchar data,
longchar targetCP)
Copies all of the bytes from a longchar into this bucket.
|
void |
putString(object<? extends LegacyString> _data)
Copies all of the bytes from a String object into this bucket.
|
private void |
readBytes(int64 p,
memptr data)
Read data into the byte array.
|
void |
resize(integer _p1)
Resizes the internal 'array' of records.
|
void |
resizeArray(integer _p1)
Resizes the internal 'array' of records.
|
void |
setPosition(int64 _var)
Set the current read position.
|
private int |
writeBytes(byte[] data,
int len)
Write the content of byte array.
|
private void |
writeBytes(memptr ptr)
Write memptr data into the bucket
|
__lang_BaseObject_constructor__, __lang_BaseObject_execute__, assertNotNull, assertNotNull, clone, getLegacyClass, getNextSibling, getPrevSibling, legacyEquals, toLegacyString
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
__lang_BaseObject_constructor__, clone, getLegacyClass, getNextSibling, getPrevSibling, isTracked, legacyEquals, toLegacyString
private static final int MAX_BYTES_PER_ROW
private int64 defaultCapacity
protected int64 position
private long writePosition
protected int64 size
protected java.util.LinkedList<byte[]> buckets
public void __core_ByteBucket_execute__()
public int64 getDefaultCapacity()
public int64 getPosition()
public void setPosition(int64 _var)
_var
- the new current read position.public int64 getSize()
public static void __core_ByteBucket_constructor__static__()
public void __core_ByteBucket_constructor__()
public void __core_ByteBucket_constructor__(int64 _defaultCapacity)
_defaultCapacity
- the default capacity of the memptrs that are held in the Bucket's array.public void __core_ByteBucket_constructor__(integer _initialSize)
_initialSize
- the initial size of the memptrs that are held in the Bucket's array.public void __core_ByteBucket_constructor__(integer initialSize, int64 defaultCapacity)
initialSize
- the initial size of the memptrs that are held in the Bucket's array.defaultCapacity
- the initial number of buckets (not used in the current implementation).public void __core_ByteBucket_destructor__()
public void clear_()
public void debug()
public void destroy()
destroy
in interface ISupportInitialize
public integer getByte()
public integer getByte(int64 _pos)
_pos
- the position at which to return the byte.public object<? extends Memptr> getBytes()
public object<? extends Memptr> getBytes(int64 size)
size
- the number of bytes to return.public object<? extends Memptr> getBytes(int64 _pos, int64 _size)
_pos
- the starting position._size
- the number of bytes to return.public raw getHash()
public raw getHash(object<? extends HashAlgorithmEnum> _p1)
_p1
- - the algorithm to use.public longchar getString()
public longchar getString(int64 size)
size
- the size of the data (in bytes) to return.public longchar getString(int64 pos, int64 size)
pos
- the start position.size
- the size of the data (in bytes) to return.public longchar getString(int64 pos, int64 size, character targetCP)
pos
- the start position.size
- the size of the data (in bytes) to return.targetCP
- the target codepage for the character data.public longchar getString(int64 _pos, int64 _size, character _sourceCP, character _targetCP)
_pos
- the start position._size
- the size of the data (in bytes) to return._sourceCP
- the source codepage for the character data._targetCP
- the target codepage for the character data.public void initialize()
initialize
in interface ISupportInitialize
public static object<? extends ByteBucket> instance()
public static object<? extends ByteBucket> instance(int64 _p1)
_p1
- the size of each memptr in the array (not used in the current implementation).public static object<? extends ByteBucket> instance(integer _p1, int64 _p2)
_p1
- the initial size of the array (not used in the current implementation)._p2
- the size of each memptr in the array (not used in the current implementation).public void putBytes(object<? extends ByteBucket> _data)
_data
- the ByteBucket instance containing the data.public void putBytes(int64 _ptr, int64 _size)
_ptr
- the pointer to memory represented by a memptr._size
- the size of the memptr represented by the pointer value.public void putBytes(memptr _ptr)
_ptr
- the memptr containing the data.public void putBytes_1(object<? extends Memptr> _mptr)
_mptr
- the Memptr instance containing the data.public void putString(longchar _data)
_data
- the longchar containing the source data.public void putString(longchar data, longchar targetCP)
data
- the longchar containing the source data.targetCP
- the target codepage used to write data into the bucket.
Defaults to UTF-8.public void putString(longchar _data, character _targetCP)
_data
- the longchar containing the source data._targetCP
- the target codepage used to write data into the bucket.
Defaults to UTF-8.public void putString(object<? extends LegacyString> _data)
_data
- the String containing the source datapublic void resize(integer _p1)
_p1
- the new size (number of records) for the internal structure.public void resizeArray(integer _p1)
_p1
- The new size (number of extents) for the array.private void readBytes(int64 p, memptr data)
p
- start position.data
- data.private void writeBytes(memptr ptr)
ptr
- the source memptrprivate int writeBytes(byte[] data, int len)
data
- the byte array datalen
- the length of data to write