|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mpjbuf.NIOBuffer
public class NIOBuffer
Native methods implementation of `RawBuffer'. Apart from array bounds checking in `gather' and `scatter', none of these methods check validity of arguments. Passing invalid arguments will generally crash the JVM. So direct use of this class is very unsafe. This class is designed specifically for use from `mpjbuf.Buffer', which provides all the necessary guarantees.
Constructor Summary | |
---|---|
NIOBuffer(int capacity,
java.nio.ByteBuffer slicedBuffer)
|
Method Summary | |
---|---|
void |
clear()
|
void |
copy(java.nio.ByteBuffer srcBuffer,
int srcOffset,
int srcLength,
int dstOffset)
|
void |
free()
|
int |
gather(boolean[] source,
int numEls,
int offs,
int[] indexes,
int bufOff)
|
int |
gather(byte[] source,
int numEls,
int offs,
int[] indexes,
int bufOff)
|
int |
gather(char[] source,
int numEls,
int offs,
int[] indexes,
int bufOff)
|
int |
gather(double[] source,
int numEls,
int offs,
int[] indexes,
int bufOff)
|
int |
gather(float[] source,
int numEls,
int offs,
int[] indexes,
int bufOff)
|
int |
gather(int[] source,
int numEls,
int offs,
int[] indexes,
int bufOff)
|
int |
gather(long[] source,
int numEls,
int offs,
int[] indexes,
int bufOff)
|
int |
gather(short[] source,
int numEls,
int offs,
int[] indexes,
int bufOff)
|
java.nio.ByteBuffer |
getBuffer()
|
int |
getByte(int bufOff)
|
int |
getCapacity()
|
int |
getInt(int bufOff,
boolean revBytes)
|
void |
putByte(int value,
int bufOff)
|
void |
putInt(int value,
int bufOff)
|
void |
read(boolean[] dest,
int dstOff,
int numEls,
int bufOff,
boolean revBytes)
|
void |
read(byte[] dest,
int dstOff,
int numEls,
int bufOff,
boolean revBytes)
|
void |
read(char[] dest,
int dstOff,
int numEls,
int bufOff,
boolean revBytes)
|
void |
read(double[] dest,
int dstOff,
int numEls,
int bufOff,
boolean revBytes)
|
void |
read(float[] dest,
int dstOff,
int numEls,
int bufOff,
boolean revBytes)
|
void |
read(int[] dest,
int dstOff,
int numEls,
int bufOff,
boolean revBytes)
|
void |
read(long[] dest,
int dstOff,
int numEls,
int bufOff,
boolean revBytes)
|
void |
read(short[] dest,
int dstOff,
int numEls,
int bufOff,
boolean revBytes)
|
int |
scatter(boolean[] dest,
int numEls,
int offs,
int[] indexes,
int bufOff,
boolean revBytes)
|
int |
scatter(byte[] dest,
int numEls,
int offs,
int[] indexes,
int bufOff,
boolean revBytes)
|
int |
scatter(char[] dest,
int numEls,
int offs,
int[] indexes,
int bufOff,
boolean revBytes)
|
int |
scatter(double[] dest,
int numEls,
int offs,
int[] indexes,
int bufOff,
boolean revBytes)
|
int |
scatter(float[] dest,
int numEls,
int offs,
int[] indexes,
int bufOff,
boolean revBytes)
|
int |
scatter(int[] dest,
int numEls,
int offs,
int[] indexes,
int bufOff,
boolean revBytes)
|
int |
scatter(long[] dest,
int numEls,
int offs,
int[] indexes,
int bufOff,
boolean revBytes)
|
int |
scatter(short[] dest,
int numEls,
int offs,
int[] indexes,
int bufOff,
boolean revBytes)
|
void |
setBuffer(java.nio.ByteBuffer buf)
|
void |
setEncoding(java.nio.ByteOrder order)
|
void |
strGather(boolean[] source,
int srcOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff)
|
void |
strGather(byte[] source,
int srcOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff)
|
void |
strGather(char[] source,
int srcOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff)
|
void |
strGather(double[] source,
int srcOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff)
|
void |
strGather(float[] source,
int srcOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff)
|
void |
strGather(int[] source,
int srcOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff)
|
void |
strGather(long[] source,
int srcOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff)
|
void |
strGather(short[] source,
int srcOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff)
|
void |
strScatter(boolean[] dest,
int dstOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff,
boolean revBytes)
|
void |
strScatter(byte[] dest,
int dstOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff,
boolean revBytes)
|
void |
strScatter(char[] dest,
int dstOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff,
boolean revBytes)
|
void |
strScatter(double[] dest,
int dstOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff,
boolean revBytes)
|
void |
strScatter(float[] dest,
int dstOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff,
boolean revBytes)
|
void |
strScatter(int[] dest,
int dstOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff,
boolean revBytes)
|
void |
strScatter(long[] dest,
int dstOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff,
boolean revBytes)
|
void |
strScatter(short[] dest,
int dstOff,
int rank,
int exts,
int strs,
int[] shape,
int bufOff,
boolean revBytes)
|
void |
write(boolean[] source,
int srcOff,
int numEls,
int bufOff)
BOOLEAN |
void |
write(byte[] source,
int srcOff,
int numEls,
int bufOff)
BYTE |
void |
write(char[] source,
int srcOff,
int numEls,
int bufOff)
CHAR |
void |
write(double[] source,
int srcOff,
int numEls,
int bufOff)
DOUBLE |
void |
write(float[] source,
int srcOff,
int numEls,
int bufOff)
FLOAT |
void |
write(int[] source,
int srcOff,
int numEls,
int bufOff)
INT |
void |
write(long[] source,
int srcOff,
int numEls,
int bufOff)
LONG |
void |
write(short[] source,
int srcOff,
int numEls,
int bufOff)
SHORT |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NIOBuffer(int capacity, java.nio.ByteBuffer slicedBuffer)
Method Detail |
---|
public void copy(java.nio.ByteBuffer srcBuffer, int srcOffset, int srcLength, int dstOffset)
copy
in interface RawBuffer
public int getCapacity()
getCapacity
in interface RawBuffer
public void setBuffer(java.nio.ByteBuffer buf)
public java.nio.ByteBuffer getBuffer()
public void setEncoding(java.nio.ByteOrder order)
public void free()
free
in interface RawBuffer
public void clear()
public void putByte(int value, int bufOff)
putByte
in interface RawBuffer
public int getByte(int bufOff)
getByte
in interface RawBuffer
public void putInt(int value, int bufOff)
putInt
in interface RawBuffer
public int getInt(int bufOff, boolean revBytes)
getInt
in interface RawBuffer
public void write(byte[] source, int srcOff, int numEls, int bufOff)
write
in interface RawBuffer
public int gather(byte[] source, int numEls, int offs, int[] indexes, int bufOff)
gather
in interface RawBuffer
public void strGather(byte[] source, int srcOff, int rank, int exts, int strs, int[] shape, int bufOff)
strGather
in interface RawBuffer
public void read(byte[] dest, int dstOff, int numEls, int bufOff, boolean revBytes)
read
in interface RawBuffer
public int scatter(byte[] dest, int numEls, int offs, int[] indexes, int bufOff, boolean revBytes)
scatter
in interface RawBuffer
public void strScatter(byte[] dest, int dstOff, int rank, int exts, int strs, int[] shape, int bufOff, boolean revBytes)
strScatter
in interface RawBuffer
public void write(short[] source, int srcOff, int numEls, int bufOff)
write
in interface RawBuffer
public int gather(short[] source, int numEls, int offs, int[] indexes, int bufOff)
gather
in interface RawBuffer
public void strGather(short[] source, int srcOff, int rank, int exts, int strs, int[] shape, int bufOff)
strGather
in interface RawBuffer
public void read(short[] dest, int dstOff, int numEls, int bufOff, boolean revBytes)
read
in interface RawBuffer
public int scatter(short[] dest, int numEls, int offs, int[] indexes, int bufOff, boolean revBytes)
scatter
in interface RawBuffer
public void strScatter(short[] dest, int dstOff, int rank, int exts, int strs, int[] shape, int bufOff, boolean revBytes)
strScatter
in interface RawBuffer
public void write(int[] source, int srcOff, int numEls, int bufOff)
write
in interface RawBuffer
public int gather(int[] source, int numEls, int offs, int[] indexes, int bufOff)
gather
in interface RawBuffer
public void strGather(int[] source, int srcOff, int rank, int exts, int strs, int[] shape, int bufOff)
strGather
in interface RawBuffer
public void read(int[] dest, int dstOff, int numEls, int bufOff, boolean revBytes)
read
in interface RawBuffer
public int scatter(int[] dest, int numEls, int offs, int[] indexes, int bufOff, boolean revBytes)
scatter
in interface RawBuffer
public void strScatter(int[] dest, int dstOff, int rank, int exts, int strs, int[] shape, int bufOff, boolean revBytes)
strScatter
in interface RawBuffer
public void write(long[] source, int srcOff, int numEls, int bufOff)
write
in interface RawBuffer
public int gather(long[] source, int numEls, int offs, int[] indexes, int bufOff)
gather
in interface RawBuffer
public void strGather(long[] source, int srcOff, int rank, int exts, int strs, int[] shape, int bufOff)
strGather
in interface RawBuffer
public void read(long[] dest, int dstOff, int numEls, int bufOff, boolean revBytes)
read
in interface RawBuffer
public int scatter(long[] dest, int numEls, int offs, int[] indexes, int bufOff, boolean revBytes)
scatter
in interface RawBuffer
public void strScatter(long[] dest, int dstOff, int rank, int exts, int strs, int[] shape, int bufOff, boolean revBytes)
strScatter
in interface RawBuffer
public void write(char[] source, int srcOff, int numEls, int bufOff)
write
in interface RawBuffer
public int gather(char[] source, int numEls, int offs, int[] indexes, int bufOff)
gather
in interface RawBuffer
public void strGather(char[] source, int srcOff, int rank, int exts, int strs, int[] shape, int bufOff)
strGather
in interface RawBuffer
public void read(char[] dest, int dstOff, int numEls, int bufOff, boolean revBytes)
read
in interface RawBuffer
public int scatter(char[] dest, int numEls, int offs, int[] indexes, int bufOff, boolean revBytes)
scatter
in interface RawBuffer
public void strScatter(char[] dest, int dstOff, int rank, int exts, int strs, int[] shape, int bufOff, boolean revBytes)
strScatter
in interface RawBuffer
public void write(float[] source, int srcOff, int numEls, int bufOff)
write
in interface RawBuffer
public int gather(float[] source, int numEls, int offs, int[] indexes, int bufOff)
gather
in interface RawBuffer
public void strGather(float[] source, int srcOff, int rank, int exts, int strs, int[] shape, int bufOff)
strGather
in interface RawBuffer
public void read(float[] dest, int dstOff, int numEls, int bufOff, boolean revBytes)
read
in interface RawBuffer
public int scatter(float[] dest, int numEls, int offs, int[] indexes, int bufOff, boolean revBytes)
scatter
in interface RawBuffer
public void strScatter(float[] dest, int dstOff, int rank, int exts, int strs, int[] shape, int bufOff, boolean revBytes)
strScatter
in interface RawBuffer
public void write(double[] source, int srcOff, int numEls, int bufOff)
write
in interface RawBuffer
public int gather(double[] source, int numEls, int offs, int[] indexes, int bufOff)
gather
in interface RawBuffer
public void strGather(double[] source, int srcOff, int rank, int exts, int strs, int[] shape, int bufOff)
strGather
in interface RawBuffer
public void read(double[] dest, int dstOff, int numEls, int bufOff, boolean revBytes)
read
in interface RawBuffer
public int scatter(double[] dest, int numEls, int offs, int[] indexes, int bufOff, boolean revBytes)
scatter
in interface RawBuffer
public void strScatter(double[] dest, int dstOff, int rank, int exts, int strs, int[] shape, int bufOff, boolean revBytes)
strScatter
in interface RawBuffer
public void write(boolean[] source, int srcOff, int numEls, int bufOff)
write
in interface RawBuffer
public int gather(boolean[] source, int numEls, int offs, int[] indexes, int bufOff)
gather
in interface RawBuffer
public void strGather(boolean[] source, int srcOff, int rank, int exts, int strs, int[] shape, int bufOff)
strGather
in interface RawBuffer
public void read(boolean[] dest, int dstOff, int numEls, int bufOff, boolean revBytes)
read
in interface RawBuffer
public int scatter(boolean[] dest, int numEls, int offs, int[] indexes, int bufOff, boolean revBytes)
scatter
in interface RawBuffer
public void strScatter(boolean[] dest, int dstOff, int rank, int exts, int strs, int[] shape, int bufOff, boolean revBytes)
strScatter
in interface RawBuffer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |