com.jniwrapper
Class NullBuffer

java.lang.Object
  |
  +--com.jniwrapper.NullBuffer
All Implemented Interfaces:
DataBuffer

public class NullBuffer
extends java.lang.Object
implements DataBuffer


Constructor Summary
NullBuffer()
           
 
Method Summary
protected  void assertZero(int offset)
           
static NullBuffer getInstance()
           
 byte readByte(int offset)
          Reads a byte at a given offset.
 void readByteArray(int offset, byte[] dstArray, int dstOffset, int length)
          Copies data from this source to an array.
 byte[] readByteArray(int offset, int length)
          Reads length bytes from this source.
 long readCallbackReference(int offset)
          Reads a callback reference (pointer) at a given offset.
 int readInt(int offset)
          Reads int (2-byte signed) value at a given offset.
 long readLong(int offset)
          Reads a long (8-byte signed) value at a given offset.
 long readPointer(int offset)
          Reads a pointer value at a given offset.
 short readShort(int offset)
          Reads a short (2-byte signed) value at a given offset.
 void resize(int newSize)
          Resizes this source so that it can hold newSize bytes.
 void writeByte(int offset, byte val)
          Writes a single byte at a given offset.
 void writeByteArray(int offset, byte[] val)
          Copies all data from the given array to this source.
 void writeByteArray(int offset, byte[] val, int srcOffset, int length)
          Copies data from an array to this source.
 void writeCallbackReference(int offset, long val)
          Writes a callback reference (pointer) at a given offset.
 void writeInt(int offset, int val)
          Writes int (4-byte signed) value at a given offset.
 void writeLong(int offset, long val)
          Writes a long (8-byte signed) value at a given offset.
 void writePointer(int offset, long val)
          Writes a pointer value at a given offset.
 void writeShort(int offset, short val)
          Writes short (2-byte signed) value at a given offset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullBuffer

public NullBuffer()
Method Detail

assertZero

protected void assertZero(int offset)

writeByte

public void writeByte(int offset,
                      byte val)
Description copied from interface: DataBuffer
Writes a single byte at a given offset.

Specified by:
writeByte in interface DataBuffer

readByte

public byte readByte(int offset)
Description copied from interface: DataBuffer
Reads a byte at a given offset.

Specified by:
readByte in interface DataBuffer

writeShort

public void writeShort(int offset,
                       short val)
Description copied from interface: DataBuffer
Writes short (2-byte signed) value at a given offset.

Specified by:
writeShort in interface DataBuffer

readShort

public short readShort(int offset)
Description copied from interface: DataBuffer
Reads a short (2-byte signed) value at a given offset.

Specified by:
readShort in interface DataBuffer

writeInt

public void writeInt(int offset,
                     int val)
Description copied from interface: DataBuffer
Writes int (4-byte signed) value at a given offset.

Specified by:
writeInt in interface DataBuffer

readInt

public int readInt(int offset)
Description copied from interface: DataBuffer
Reads int (2-byte signed) value at a given offset.

Specified by:
readInt in interface DataBuffer

writeLong

public void writeLong(int offset,
                      long val)
Description copied from interface: DataBuffer
Writes a long (8-byte signed) value at a given offset.

Specified by:
writeLong in interface DataBuffer

readLong

public long readLong(int offset)
Description copied from interface: DataBuffer
Reads a long (8-byte signed) value at a given offset.

Specified by:
readLong in interface DataBuffer

writePointer

public void writePointer(int offset,
                         long val)
Description copied from interface: DataBuffer
Writes a pointer value at a given offset.

Specified by:
writePointer in interface DataBuffer

readPointer

public long readPointer(int offset)
Description copied from interface: DataBuffer
Reads a pointer value at a given offset.

Specified by:
readPointer in interface DataBuffer

writeCallbackReference

public void writeCallbackReference(int offset,
                                   long val)
Description copied from interface: DataBuffer
Writes a callback reference (pointer) at a given offset.

Specified by:
writeCallbackReference in interface DataBuffer

readCallbackReference

public long readCallbackReference(int offset)
Description copied from interface: DataBuffer
Reads a callback reference (pointer) at a given offset.

Specified by:
readCallbackReference in interface DataBuffer

writeByteArray

public void writeByteArray(int offset,
                           byte[] val,
                           int srcOffset,
                           int length)
Description copied from interface: DataBuffer
Copies data from an array to this source.

Specified by:
writeByteArray in interface DataBuffer
Parameters:
offset - target offset in this DataSource
val - where to get data
srcOffset - starting offset in the val array
length - number of bytes to copy

readByteArray

public void readByteArray(int offset,
                          byte[] dstArray,
                          int dstOffset,
                          int length)
Description copied from interface: DataBuffer
Copies data from this source to an array.

Specified by:
readByteArray in interface DataBuffer
Parameters:
offset - source offset in this DataSource
dstArray - where to put data
dstOffset - starting offset in the dstArray array
length - number of bytes to copy

writeByteArray

public void writeByteArray(int offset,
                           byte[] val)
Description copied from interface: DataBuffer
Copies all data from the given array to this source.

Specified by:
writeByteArray in interface DataBuffer

readByteArray

public byte[] readByteArray(int offset,
                            int length)
Description copied from interface: DataBuffer
Reads length bytes from this source.

Specified by:
readByteArray in interface DataBuffer

resize

public void resize(int newSize)
Description copied from interface: DataBuffer
Resizes this source so that it can hold newSize bytes.

Specified by:
resize in interface DataBuffer

getInstance

public static NullBuffer getInstance()