public class SqlJetByteBuffer extends java.lang.Object implements ISqlJetMemoryBuffer
Modifier and Type | Field and Description |
---|---|
protected java.nio.ByteBuffer |
buffer |
Constructor and Description |
---|
SqlJetByteBuffer() |
SqlJetByteBuffer(java.nio.ByteBuffer b) |
Modifier and Type | Method and Description |
---|---|
void |
allocate(int size)
Allocate chunk of memory.
|
byte[] |
asArray() |
int |
compareTo(int pointer,
ISqlJetMemoryBuffer buffer,
int bufferPointer) |
void |
copyFrom(int dstPos,
ISqlJetMemoryBuffer src,
int srcPos,
int count) |
void |
fill(int from,
int count,
byte value) |
void |
free()
Fries chunk of memory.
|
byte |
getByte(int pointer)
Read byte at pointer.
|
void |
getBytes(int pointer,
byte[] bytes,
int to,
int count) |
int |
getByteUnsigned(int pointer)
Read unsigned byte at pointer.
|
int |
getInt(int pointer)
Read int at pointer.
|
long |
getIntUnsigned(int pointer)
Read unsigned int at pointer.
|
long |
getLong(int pointer)
Read long at pointer.
|
ISqlJetMemoryPointer |
getPointer(int pointer)
Returns pointer in memory chunk at passed offset.
|
short |
getShort(int pointer)
Read short at pointer.
|
int |
getShortUnsigned(int pointer)
Read unsigned short at pointer.
|
int |
getSize()
Size of allocated memory chunk.
|
boolean |
isAllocated()
Returns true if memory is allocated.
|
void |
putByte(int pointer,
byte value)
Write byte at pointer.
|
void |
putBytes(int pointer,
byte[] bytes,
int from,
int count) |
void |
putByteUnsigned(int pointer,
int value)
Write unsigned byte at pointer.
|
void |
putInt(int pointer,
int value)
Write int at pointer.
|
void |
putIntUnsigned(int pointer,
long value)
Write unsigned int at pointer.
|
void |
putLong(int pointer,
long value)
Write long at pointer.
|
void |
putShort(int pointer,
short value)
Write short at pointer.
|
void |
putShortUnsigned(int pointer,
int value)
Write unsigned short at pointer.
|
int |
readFromFile(int pointer,
java.io.RandomAccessFile file,
long position,
int count)
Read from file into memory chunk at pointer.
|
int |
writeToFile(int pointer,
java.io.RandomAccessFile file,
long position,
int count)
Write from memory chunk at pointer to file.
|
public SqlJetByteBuffer()
public SqlJetByteBuffer(java.nio.ByteBuffer b)
b
- public void allocate(int size)
ISqlJetMemoryBuffer
allocate
in interface ISqlJetMemoryBuffer
size
- size of chunk in bytespublic void free()
ISqlJetMemoryBuffer
free
in interface ISqlJetMemoryBuffer
public boolean isAllocated()
ISqlJetMemoryBuffer
isAllocated
in interface ISqlJetMemoryBuffer
public int getSize()
ISqlJetMemoryBuffer
getSize
in interface ISqlJetMemoryBuffer
public ISqlJetMemoryPointer getPointer(int pointer)
ISqlJetMemoryBuffer
getPointer
in interface ISqlJetMemoryBuffer
public byte getByte(int pointer)
ISqlJetMemoryBuffer
getByte
in interface ISqlJetMemoryBuffer
public int getByteUnsigned(int pointer)
ISqlJetMemoryBuffer
getByteUnsigned
in interface ISqlJetMemoryBuffer
public int getInt(int pointer)
ISqlJetMemoryBuffer
getInt
in interface ISqlJetMemoryBuffer
public long getIntUnsigned(int pointer)
ISqlJetMemoryBuffer
getIntUnsigned
in interface ISqlJetMemoryBuffer
public long getLong(int pointer)
ISqlJetMemoryBuffer
getLong
in interface ISqlJetMemoryBuffer
public short getShort(int pointer)
ISqlJetMemoryBuffer
getShort
in interface ISqlJetMemoryBuffer
public int getShortUnsigned(int pointer)
ISqlJetMemoryBuffer
getShortUnsigned
in interface ISqlJetMemoryBuffer
public void putByte(int pointer, byte value)
ISqlJetMemoryBuffer
putByte
in interface ISqlJetMemoryBuffer
public void putByteUnsigned(int pointer, int value)
ISqlJetMemoryBuffer
putByteUnsigned
in interface ISqlJetMemoryBuffer
public void putInt(int pointer, int value)
ISqlJetMemoryBuffer
putInt
in interface ISqlJetMemoryBuffer
public void putIntUnsigned(int pointer, long value)
ISqlJetMemoryBuffer
putIntUnsigned
in interface ISqlJetMemoryBuffer
public void putLong(int pointer, long value)
ISqlJetMemoryBuffer
putLong
in interface ISqlJetMemoryBuffer
public void putShort(int pointer, short value)
ISqlJetMemoryBuffer
putShort
in interface ISqlJetMemoryBuffer
public void putShortUnsigned(int pointer, int value)
ISqlJetMemoryBuffer
putShortUnsigned
in interface ISqlJetMemoryBuffer
public int readFromFile(int pointer, java.io.RandomAccessFile file, long position, int count) throws java.io.IOException
ISqlJetMemoryBuffer
readFromFile
in interface ISqlJetMemoryBuffer
java.io.IOException
public int writeToFile(int pointer, java.io.RandomAccessFile file, long position, int count) throws java.io.IOException
ISqlJetMemoryBuffer
writeToFile
in interface ISqlJetMemoryBuffer
java.io.IOException
public byte[] asArray()
asArray
in interface ISqlJetMemoryBuffer
public void copyFrom(int dstPos, ISqlJetMemoryBuffer src, int srcPos, int count)
copyFrom
in interface ISqlJetMemoryBuffer
public void fill(int from, int count, byte value)
fill
in interface ISqlJetMemoryBuffer
public void getBytes(int pointer, byte[] bytes, int to, int count)
getBytes
in interface ISqlJetMemoryBuffer
public void putBytes(int pointer, byte[] bytes, int from, int count)
putBytes
in interface ISqlJetMemoryBuffer
public int compareTo(int pointer, ISqlJetMemoryBuffer buffer, int bufferPointer)
compareTo
in interface ISqlJetMemoryBuffer
Copyright © 2009-2010 TMate Software Ltd. All Rights Reserved.