|
Sea 0.4.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.lbl.dsd.sea.nio.util.ByteConverter
Efficient big endian array conversions for high performance I/O through bulk data
transfer rather than piece-wise transfer. (You may want to disregard this class in
favour of the conversion facilities in the ByteBuffer
family of classes).
Avoids deep non-inlined synchronized call chains in the java.io package. The following conversions are supported:
DataInputStream
and
DataOutputStream
. In fact, this is a copy&paste of the JDK 1.4.2
source code of these two classes, with efficient loops written around.
Not only for disk I/O, but also for other kinds of serialization, e.g. high bandwidth networking.
FileOutputStream.write(byte[], int, int)
, perhaps buffered.FileInputStream.read(byte[], int, int)
, perhaps buffered.
System.arraycopy(java.lang.Object, int, java.lang.Object, int, int)
, except for
the length argument which is always given in primitive element units!
Please don't flame for not writing redundant javadoc for each and every method.
Field Summary | |
static int |
SIZE_OF_BOOLEAN
|
static int |
SIZE_OF_BYTE
|
static int |
SIZE_OF_CHAR
|
static int |
SIZE_OF_DOUBLE
|
static int |
SIZE_OF_FLOAT
|
static int |
SIZE_OF_INT
|
static int |
SIZE_OF_LONG
|
static int |
SIZE_OF_SHORT
|
Method Summary | |
static void |
read(byte[] src,
int srcPos,
boolean[] dest,
int destPos,
int length)
|
static void |
read(byte[] src,
int srcPos,
byte[] dest,
int destPos,
int length)
|
static void |
read(byte[] src,
int srcPos,
char[] dest,
int destPos,
int length)
|
static void |
read(byte[] src,
int srcPos,
double[] dest,
int destPos,
int length)
|
static void |
read(byte[] src,
int srcPos,
float[] dest,
int destPos,
int length)
|
static void |
read(byte[] src,
int srcPos,
int[] dest,
int destPos,
int length)
|
static void |
read(byte[] src,
int srcPos,
long[] dest,
int destPos,
int length)
|
static void |
read(byte[] src,
int srcPos,
short[] dest,
int destPos,
int length)
|
static boolean |
readBoolean(byte[] src,
int srcPos)
|
static byte |
readByte(byte[] src,
int srcPos)
|
static char |
readChar(byte[] src,
int srcPos)
|
static double |
readDouble(byte[] src,
int srcPos)
|
static float |
readFloat(byte[] src,
int srcPos)
|
static int |
readInt(byte[] src,
int srcPos)
|
static long |
readLong(byte[] src,
int srcPos)
|
static short |
readShort(byte[] src,
int srcPos)
|
static int |
readUnsignedByte(byte v)
Returns the integer value gained when interpreting the value v as an unsigned byte. |
static int |
readUnsignedByte(byte[] src,
int srcPos)
|
static long |
readUnsignedInt(byte[] src,
int srcPos)
|
static long |
readUnsignedInt(int v)
Returns the long value gained when interpreting the value v as an unsigned int. |
static int |
readUnsignedShort(byte[] src,
int srcPos)
|
static int |
readUnsignedShort(short v)
Returns the integer value gained when interpreting the value v as an unsigned short. |
static void |
write(boolean[] src,
int srcPos,
byte[] dest,
int destPos,
int length)
|
static void |
write(byte[] src,
int srcPos,
byte[] dest,
int destPos,
int length)
|
static void |
write(char[] src,
int srcPos,
byte[] dest,
int destPos,
int length)
|
static void |
write(double[] src,
int srcPos,
byte[] dest,
int destPos,
int length)
|
static void |
write(float[] src,
int srcPos,
byte[] dest,
int destPos,
int length)
|
static void |
write(int[] src,
int srcPos,
byte[] dest,
int destPos,
int length)
|
static void |
write(long[] src,
int srcPos,
byte[] dest,
int destPos,
int length)
|
static void |
write(short[] src,
int srcPos,
byte[] dest,
int destPos,
int length)
|
static void |
writeBoolean(boolean v,
byte[] dest,
int destPos)
|
static void |
writeByte(byte v,
byte[] dest,
int destPos)
|
static void |
writeChar(char v,
byte[] dest,
int destPos)
|
static void |
writeDouble(double src,
byte[] dest,
int destPos)
|
static void |
writeFloat(float v,
byte[] dest,
int destPos)
|
static void |
writeInt(int v,
byte[] dest,
int destPos)
|
static void |
writeLong(long v,
byte[] dest,
int destPos)
|
static void |
writeShort(short v,
byte[] dest,
int destPos)
|
static void |
writeUnsignedInt(long v,
byte[] dest,
int destPos)
|
static void |
writeUnsignedShort(int v,
byte[] dest,
int destPos)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SIZE_OF_BOOLEAN
public static final int SIZE_OF_BYTE
public static final int SIZE_OF_CHAR
public static final int SIZE_OF_SHORT
public static final int SIZE_OF_INT
public static final int SIZE_OF_FLOAT
public static final int SIZE_OF_LONG
public static final int SIZE_OF_DOUBLE
Method Detail |
public static byte readByte(byte[] src, int srcPos)
public static boolean readBoolean(byte[] src, int srcPos)
public static char readChar(byte[] src, int srcPos)
public static short readShort(byte[] src, int srcPos)
public static int readInt(byte[] src, int srcPos)
public static float readFloat(byte[] src, int srcPos)
public static long readLong(byte[] src, int srcPos)
public static double readDouble(byte[] src, int srcPos)
public static int readUnsignedByte(byte[] src, int srcPos)
public static int readUnsignedShort(byte[] src, int srcPos)
public static long readUnsignedInt(byte[] src, int srcPos)
public static int readUnsignedByte(byte v)
public static int readUnsignedShort(short v)
public static long readUnsignedInt(int v)
public static void read(byte[] src, int srcPos, byte[] dest, int destPos, int length)
public static void read(byte[] src, int srcPos, boolean[] dest, int destPos, int length)
public static void read(byte[] src, int srcPos, char[] dest, int destPos, int length)
public static void read(byte[] src, int srcPos, short[] dest, int destPos, int length)
public static void read(byte[] src, int srcPos, int[] dest, int destPos, int length)
public static void read(byte[] src, int srcPos, float[] dest, int destPos, int length)
public static void read(byte[] src, int srcPos, long[] dest, int destPos, int length)
public static void read(byte[] src, int srcPos, double[] dest, int destPos, int length)
public static void writeByte(byte v, byte[] dest, int destPos)
public static void writeBoolean(boolean v, byte[] dest, int destPos)
public static void writeChar(char v, byte[] dest, int destPos)
public static void writeShort(short v, byte[] dest, int destPos)
public static void writeFloat(float v, byte[] dest, int destPos)
public static void writeInt(int v, byte[] dest, int destPos)
public static void writeLong(long v, byte[] dest, int destPos)
public static void writeDouble(double src, byte[] dest, int destPos)
public static void writeUnsignedShort(int v, byte[] dest, int destPos)
public static void writeUnsignedInt(long v, byte[] dest, int destPos)
public static void write(byte[] src, int srcPos, byte[] dest, int destPos, int length)
public static void write(boolean[] src, int srcPos, byte[] dest, int destPos, int length)
public static void write(char[] src, int srcPos, byte[] dest, int destPos, int length)
public static void write(short[] src, int srcPos, byte[] dest, int destPos, int length)
public static void write(int[] src, int srcPos, byte[] dest, int destPos, int length)
public static void write(float[] src, int srcPos, byte[] dest, int destPos, int length)
public static void write(long[] src, int srcPos, byte[] dest, int destPos, int length)
public static void write(double[] src, int srcPos, byte[] dest, int destPos, int length)
|
Sea 0.4.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |