org.tmatesoft.sqljet.core.internal.memory
Class SqlJetMemoryPointer

java.lang.Object
  extended by org.tmatesoft.sqljet.core.internal.memory.SqlJetMemoryPointer
All Implemented Interfaces:
ISqlJetMemoryPointer

public final class SqlJetMemoryPointer
extends java.lang.Object
implements ISqlJetMemoryPointer


Constructor Summary
SqlJetMemoryPointer(ISqlJetMemoryBuffer buffer, int pointer)
           
SqlJetMemoryPointer(ISqlJetMemoryBuffer buffer, int pointer, int limit)
           
 
Method Summary
 int compareTo(ISqlJetMemoryPointer ptr)
           
 void copyFrom(int dstPos, ISqlJetMemoryPointer src, int srcPos, int length)
           
 void copyFrom(ISqlJetMemoryPointer src, int length)
           
 void copyFrom(ISqlJetMemoryPointer src, int srcPos, int length)
           
 void fill(int count, byte value)
           
 void fill(int from, int count, byte value)
           
 int getAbsolute(int pointer)
           
 ISqlJetMemoryBuffer getBuffer()
          Get buffer which contains pointer.
 byte getByte()
          Read byte at current address.
 byte getByte(int pointer)
          Read byte at pointer.
 void getBytes(byte[] bytes)
           
 void getBytes(int pointer, byte[] bytes)
           
 void getBytes(int pointer, byte[] bytes, int count)
           
 void getBytes(int pointer, byte[] bytes, int to, int count)
           
 int getByteUnsigned()
          Read unsigned byte at current address.
 int getByteUnsigned(int pointer)
          Read unsigned byte at pointer.
 ISqlJetMemoryPointer getIdentic()
           
 int getInt()
          Read int at current address.
 int getInt(int pointer)
          Read int at pointer.
 long getIntUnsigned()
          Read unsigned int at current address.
 long getIntUnsigned(int pointer)
          Read unsigned int at pointer.
 int getLimit()
           
 long getLong()
          Read long at current address.
 long getLong(int pointer)
          Read long at pointer.
 ISqlJetMemoryPointer getMoved(int count)
           
 int getPointer()
          Get pointer address (offset in buffer).
 short getShort()
          Read short at current address.
 short getShort(int pointer)
          Read short at pointer.
 int getShortUnsigned()
          Read unsigned short at current address.
 int getShortUnsigned(int pointer)
          Read unsigned short at pointer.
 void limit(int n)
           
 void movePointer(int count)
          Move pointer.
 void putByte(byte value)
          Write byte at current address.
 void putByte(int pointer, byte value)
          Write byte at pointer.
 void putBytes(byte[] bytes)
           
 void putBytes(int pointer, byte[] bytes)
           
 void putBytes(int pointer, byte[] bytes, int count)
           
 void putBytes(int pointer, byte[] bytes, int to, int count)
           
 void putByteUnsigned(int value)
          Write unsigned byte at current address.
 void putByteUnsigned(int pointer, int value)
          Write unsigned byte at pointer.
 void putInt(int value)
          Write int at current address.
 void putInt(int pointer, int value)
          Write int at pointer.
 void putIntUnsigned(int pointer, long value)
          Write unsigned int at pointer.
 void putIntUnsigned(long value)
          Write unsigned int at current address.
 void putLong(int pointer, long value)
          Write long at pointer.
 void putLong(long value)
          Write long at current address.
 void putShort(int pointer, short value)
          Write short at pointer.
 void putShort(short value)
          Write short at current address.
 void putShortUnsigned(int value)
          Write unsigned short at current address.
 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 readFromFile(java.io.RandomAccessFile file, long position, int count)
          Read from file at current address.
 int remaining()
           
 void setPointer(int pointer)
          Set pointer address (offset in buffer).
 int writeToFile(int pointer, java.io.RandomAccessFile file, long position, int count)
          Write from memory chunk at pointer to file.
 int writeToFile(java.io.RandomAccessFile file, long position, int count)
          Write to file at current address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlJetMemoryPointer

public SqlJetMemoryPointer(ISqlJetMemoryBuffer buffer,
                           int pointer)

SqlJetMemoryPointer

public SqlJetMemoryPointer(ISqlJetMemoryBuffer buffer,
                           int pointer,
                           int limit)
Method Detail

getBuffer

public final ISqlJetMemoryBuffer getBuffer()
Description copied from interface: ISqlJetMemoryPointer
Get buffer which contains pointer.

Specified by:
getBuffer in interface ISqlJetMemoryPointer
Returns:

getPointer

public final int getPointer()
Description copied from interface: ISqlJetMemoryPointer
Get pointer address (offset in buffer).

Specified by:
getPointer in interface ISqlJetMemoryPointer
Returns:

setPointer

public final void setPointer(int pointer)
Description copied from interface: ISqlJetMemoryPointer
Set pointer address (offset in buffer).

Specified by:
setPointer in interface ISqlJetMemoryPointer

movePointer

public final void movePointer(int count)
Description copied from interface: ISqlJetMemoryPointer
Move pointer. Add some count to pointer address. Count may be negative.

Specified by:
movePointer in interface ISqlJetMemoryPointer
Parameters:
count - count which added to address. May be negative.

getByte

public final byte getByte()
Description copied from interface: ISqlJetMemoryPointer
Read byte at current address.

Specified by:
getByte in interface ISqlJetMemoryPointer
Returns:

getInt

public final int getInt()
Description copied from interface: ISqlJetMemoryPointer
Read int at current address.

Specified by:
getInt in interface ISqlJetMemoryPointer
Returns:

getLong

public final long getLong()
Description copied from interface: ISqlJetMemoryPointer
Read long at current address.

Specified by:
getLong in interface ISqlJetMemoryPointer
Returns:

getShort

public final short getShort()
Description copied from interface: ISqlJetMemoryPointer
Read short at current address.

Specified by:
getShort in interface ISqlJetMemoryPointer
Returns:

getByteUnsigned

public final int getByteUnsigned()
Description copied from interface: ISqlJetMemoryPointer
Read unsigned byte at current address.

Specified by:
getByteUnsigned in interface ISqlJetMemoryPointer
Returns:

getIntUnsigned

public final long getIntUnsigned()
Description copied from interface: ISqlJetMemoryPointer
Read unsigned int at current address.

Specified by:
getIntUnsigned in interface ISqlJetMemoryPointer
Returns:

getShortUnsigned

public final int getShortUnsigned()
Description copied from interface: ISqlJetMemoryPointer
Read unsigned short at current address.

Specified by:
getShortUnsigned in interface ISqlJetMemoryPointer
Returns:

putByte

public final void putByte(byte value)
Description copied from interface: ISqlJetMemoryPointer
Write byte at current address.

Specified by:
putByte in interface ISqlJetMemoryPointer

putInt

public final void putInt(int value)
Description copied from interface: ISqlJetMemoryPointer
Write int at current address.

Specified by:
putInt in interface ISqlJetMemoryPointer

putLong

public final void putLong(long value)
Description copied from interface: ISqlJetMemoryPointer
Write long at current address.

Specified by:
putLong in interface ISqlJetMemoryPointer

putShort

public final void putShort(short value)
Description copied from interface: ISqlJetMemoryPointer
Write short at current address.

Specified by:
putShort in interface ISqlJetMemoryPointer

putByteUnsigned

public final void putByteUnsigned(int value)
Description copied from interface: ISqlJetMemoryPointer
Write unsigned byte at current address.

Specified by:
putByteUnsigned in interface ISqlJetMemoryPointer

putIntUnsigned

public final void putIntUnsigned(long value)
Description copied from interface: ISqlJetMemoryPointer
Write unsigned int at current address.

Specified by:
putIntUnsigned in interface ISqlJetMemoryPointer

putShortUnsigned

public final void putShortUnsigned(int value)
Description copied from interface: ISqlJetMemoryPointer
Write unsigned short at current address.

Specified by:
putShortUnsigned in interface ISqlJetMemoryPointer

readFromFile

public final int readFromFile(java.io.RandomAccessFile file,
                              long position,
                              int count)
                       throws java.io.IOException
Description copied from interface: ISqlJetMemoryPointer
Read from file at current address.

Specified by:
readFromFile in interface ISqlJetMemoryPointer
Returns:
Throws:
java.io.IOException

writeToFile

public final int writeToFile(java.io.RandomAccessFile file,
                             long position,
                             int count)
                      throws java.io.IOException
Description copied from interface: ISqlJetMemoryPointer
Write to file at current address.

Specified by:
writeToFile in interface ISqlJetMemoryPointer
Returns:
Throws:
java.io.IOException

getAbsolute

public final int getAbsolute(int pointer)
Specified by:
getAbsolute in interface ISqlJetMemoryPointer
Parameters:
pointer -
Returns:

getByte

public final byte getByte(int pointer)
Description copied from interface: ISqlJetMemoryPointer
Read byte at pointer.

Specified by:
getByte in interface ISqlJetMemoryPointer
Returns:

getByteUnsigned

public final int getByteUnsigned(int pointer)
Description copied from interface: ISqlJetMemoryPointer
Read unsigned byte at pointer.

Specified by:
getByteUnsigned in interface ISqlJetMemoryPointer
Returns:

getInt

public final int getInt(int pointer)
Description copied from interface: ISqlJetMemoryPointer
Read int at pointer.

Specified by:
getInt in interface ISqlJetMemoryPointer
Returns:

getIntUnsigned

public final long getIntUnsigned(int pointer)
Description copied from interface: ISqlJetMemoryPointer
Read unsigned int at pointer.

Specified by:
getIntUnsigned in interface ISqlJetMemoryPointer
Returns:

getLong

public final long getLong(int pointer)
Description copied from interface: ISqlJetMemoryPointer
Read long at pointer.

Specified by:
getLong in interface ISqlJetMemoryPointer
Returns:

getShort

public final short getShort(int pointer)
Description copied from interface: ISqlJetMemoryPointer
Read short at pointer.

Specified by:
getShort in interface ISqlJetMemoryPointer
Returns:

getShortUnsigned

public final int getShortUnsigned(int pointer)
Description copied from interface: ISqlJetMemoryPointer
Read unsigned short at pointer.

Specified by:
getShortUnsigned in interface ISqlJetMemoryPointer
Returns:

putByte

public final void putByte(int pointer,
                          byte value)
Description copied from interface: ISqlJetMemoryPointer
Write byte at pointer.

Specified by:
putByte in interface ISqlJetMemoryPointer

putByteUnsigned

public final void putByteUnsigned(int pointer,
                                  int value)
Description copied from interface: ISqlJetMemoryPointer
Write unsigned byte at pointer.

Specified by:
putByteUnsigned in interface ISqlJetMemoryPointer

putInt

public final void putInt(int pointer,
                         int value)
Description copied from interface: ISqlJetMemoryPointer
Write int at pointer.

Specified by:
putInt in interface ISqlJetMemoryPointer

putIntUnsigned

public final void putIntUnsigned(int pointer,
                                 long value)
Description copied from interface: ISqlJetMemoryPointer
Write unsigned int at pointer.

Specified by:
putIntUnsigned in interface ISqlJetMemoryPointer

putLong

public final void putLong(int pointer,
                          long value)
Description copied from interface: ISqlJetMemoryPointer
Write long at pointer.

Specified by:
putLong in interface ISqlJetMemoryPointer

putShort

public final void putShort(int pointer,
                           short value)
Description copied from interface: ISqlJetMemoryPointer
Write short at pointer.

Specified by:
putShort in interface ISqlJetMemoryPointer

putShortUnsigned

public final void putShortUnsigned(int pointer,
                                   int value)
Description copied from interface: ISqlJetMemoryPointer
Write unsigned short at pointer.

Specified by:
putShortUnsigned in interface ISqlJetMemoryPointer

readFromFile

public final int readFromFile(int pointer,
                              java.io.RandomAccessFile file,
                              long position,
                              int count)
                       throws java.io.IOException
Description copied from interface: ISqlJetMemoryPointer
Read from file into memory chunk at pointer. Method isn't synchronized on file.

Specified by:
readFromFile in interface ISqlJetMemoryPointer
Returns:
Throws:
java.io.IOException

writeToFile

public final int writeToFile(int pointer,
                             java.io.RandomAccessFile file,
                             long position,
                             int count)
                      throws java.io.IOException
Description copied from interface: ISqlJetMemoryPointer
Write from memory chunk at pointer to file. Method isn't synchronized on file.

Specified by:
writeToFile in interface ISqlJetMemoryPointer
Returns:
Throws:
java.io.IOException

remaining

public final int remaining()
Specified by:
remaining in interface ISqlJetMemoryPointer
Returns:

copyFrom

public final void copyFrom(int dstPos,
                           ISqlJetMemoryPointer src,
                           int srcPos,
                           int length)
Specified by:
copyFrom in interface ISqlJetMemoryPointer

copyFrom

public final void copyFrom(ISqlJetMemoryPointer src,
                           int srcPos,
                           int length)
Specified by:
copyFrom in interface ISqlJetMemoryPointer

copyFrom

public final void copyFrom(ISqlJetMemoryPointer src,
                           int length)
Specified by:
copyFrom in interface ISqlJetMemoryPointer

fill

public final void fill(int count,
                       byte value)
Specified by:
fill in interface ISqlJetMemoryPointer

fill

public final void fill(int from,
                       int count,
                       byte value)
Specified by:
fill in interface ISqlJetMemoryPointer

getBytes

public final void getBytes(byte[] bytes)
Specified by:
getBytes in interface ISqlJetMemoryPointer

getBytes

public final void getBytes(int pointer,
                           byte[] bytes)
Specified by:
getBytes in interface ISqlJetMemoryPointer

getBytes

public final void getBytes(int pointer,
                           byte[] bytes,
                           int count)
Specified by:
getBytes in interface ISqlJetMemoryPointer

getBytes

public final void getBytes(int pointer,
                           byte[] bytes,
                           int to,
                           int count)
Specified by:
getBytes in interface ISqlJetMemoryPointer

putBytes

public final void putBytes(byte[] bytes)
Specified by:
putBytes in interface ISqlJetMemoryPointer

putBytes

public final void putBytes(int pointer,
                           byte[] bytes)
Specified by:
putBytes in interface ISqlJetMemoryPointer

putBytes

public final void putBytes(int pointer,
                           byte[] bytes,
                           int count)
Specified by:
putBytes in interface ISqlJetMemoryPointer

putBytes

public final void putBytes(int pointer,
                           byte[] bytes,
                           int to,
                           int count)
Specified by:
putBytes in interface ISqlJetMemoryPointer

compareTo

public final int compareTo(ISqlJetMemoryPointer ptr)
Specified by:
compareTo in interface ISqlJetMemoryPointer
Returns:

limit

public final void limit(int n)
Specified by:
limit in interface ISqlJetMemoryPointer

getLimit

public final int getLimit()
Specified by:
getLimit in interface ISqlJetMemoryPointer

getIdentic

public final ISqlJetMemoryPointer getIdentic()
Specified by:
getIdentic in interface ISqlJetMemoryPointer

getMoved

public ISqlJetMemoryPointer getMoved(int count)
Specified by:
getMoved in interface ISqlJetMemoryPointer