|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.x11.Data
public class Data
Efficient storage of byte array. Similar to "struct" in C/C++. No parsing.
Field Summary | |
---|---|
byte[] |
data
|
int |
index
Sequential writing. |
int |
offset
Lower bound. |
Constructor Summary | |
---|---|
Data()
Writing. |
|
Data(byte[] data)
Reading. |
|
Data(byte[][] data)
Reading. |
|
Data(byte[][][] data)
Reading. |
|
Data(Data data)
Reading. |
|
Data(Data data,
int offset)
Offset Reading. |
|
Data(float[] data)
Reading. |
|
Data(float[][][] data)
Reading. |
|
Data(int length)
Writing. |
|
Data(int[][][] data)
Reading. |
|
Data(int[] data,
int unit_size)
Reading. |
Method Summary | |
---|---|
static java.lang.String |
byte_to_string(int b)
|
static int |
len(int n)
Padded length. |
static int |
len(java.lang.String s)
Padded length. |
int |
n()
Length of byte data. |
int |
np()
Padded length of byte data. |
int |
p()
Padding length to make a unit of four. |
void |
pad(int n)
Writes X bytes of zero, where X is the number that pads n to a multiple of 4. |
boolean |
read_boolean(int j)
|
double |
read_double(int j)
|
float |
read_float(int j)
|
java.lang.String |
read_string(int j,
int length)
|
int |
read1(int j)
|
int |
read2(int j)
|
boolean |
read4_boolean(int j)
|
int |
read4(int j)
|
long |
read8(int j)
|
static java.lang.String |
to_string(byte[] buffer,
int offset,
int length,
java.lang.String prefix)
|
java.lang.String |
toString()
|
static int |
unit(byte[] b)
Padded unit. |
static int |
unit(int n)
Padded unit. |
static int |
unit(java.lang.String s)
Padded unit. |
void |
write_string16(int j,
java.lang.String s)
Writes a field of type STRING16 into the data buffer at the specified position. |
void |
write_string16(java.lang.String s)
Writes a field of type STRING16 into the data buffer. |
void |
write_unused(int i)
|
void |
write1_unused()
|
void |
write1(boolean b)
|
void |
write1(byte[] b)
|
void |
write1(byte[] b,
int offset)
|
void |
write1(byte[] b,
int offset,
int length)
|
void |
write1(Data d)
|
void |
write1(int b)
|
void |
write1(int j,
boolean b)
|
void |
write1(int j,
byte[] b)
|
void |
write1(int j,
byte[] b,
int offset)
|
void |
write1(int j,
byte[] b,
int offset,
int length)
|
void |
write1(int j,
Data d)
|
void |
write1(int j,
int b)
|
void |
write1(int j,
java.lang.String s)
|
void |
write1(java.lang.String s)
|
void |
write2_unused()
|
void |
write2(byte[] b)
|
void |
write2(byte[] b,
int offset)
|
void |
write2(byte[] b,
int offset,
int length)
|
void |
write2(int s)
|
void |
write2(int[] b)
|
void |
write2(int[] s,
int offset)
|
void |
write2(int[] s,
int offset,
int length)
|
void |
write2(int j,
byte[] b,
int offset)
|
void |
write2(int j,
byte[] b,
int offset,
int length)
|
void |
write2(int j,
int s)
|
void |
write2(int j,
int[] s,
int offset)
|
void |
write2(int j,
int[] s,
int offset,
int length)
|
void |
write2(int j,
java.lang.String s)
|
void |
write2(java.lang.String s)
|
void |
write3_unused()
|
void |
write4_unused()
|
void |
write4(float f)
|
void |
write4(float[] f)
|
void |
write4(float[] f,
int offset)
|
void |
write4(float[] f,
int offset,
int length)
|
void |
write4(int i)
|
void |
write4(int[] i)
|
void |
write4(int[] i,
int offset)
|
void |
write4(int[] i,
int offset,
int length)
|
void |
write4(int j,
boolean b)
|
void |
write4(int j,
float f)
|
void |
write4(int j,
float[] f,
int offset)
|
void |
write4(int j,
float[] f,
int offset,
int length)
|
void |
write4(int j,
int i)
|
void |
write4(int j,
int[] i,
int offset)
|
void |
write4(int j,
int[] i,
int offset,
int length)
|
void |
write8(double d)
|
void |
write8(double[] d,
int offset)
|
void |
write8(double[] d,
int offset,
int length)
|
void |
write8(int j,
double d)
|
void |
write8(int j,
double[] d,
int offset)
|
void |
write8(int j,
double[] d,
int offset,
int length)
|
void |
write8(int j,
long l)
|
void |
write8(long l)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int index
public int offset
public byte[] data
Constructor Detail |
---|
public Data()
public Data(int length)
public Data(byte[] data)
public Data(byte[][] data)
public Data(byte[][][] data)
public Data(float[] data)
public Data(float[][][] data)
public Data(int[][][] data)
public Data(Data data)
public Data(int[] data, int unit_size)
public Data(Data data, int offset)
Method Detail |
---|
public static int len(int n)
public static int len(java.lang.String s)
public static int unit(byte[] b)
public static int unit(int n)
public static int unit(java.lang.String s)
public int read1(int j)
public int read2(int j)
public int read4(int j)
public long read8(int j)
public boolean read_boolean(int j)
public boolean read4_boolean(int j)
public double read_double(int j)
public float read_float(int j)
public java.lang.String read_string(int j, int length)
public void write1(int j, boolean b)
public void write1(int j, byte[] b)
public void write1(int j, byte[] b, int offset)
public void write1(int j, byte[] b, int offset, int length)
public void write1(int j, int b)
public void write1(int j, Data d)
public void write1(int j, java.lang.String s)
public void write1(boolean b)
public void write1(byte[] b)
public void write1(int b)
public void write1(Data d)
public void write1(java.lang.String s)
public void write_string16(java.lang.String s)
s
- the string to writepublic void write_string16(int j, java.lang.String s)
j
- the index where to write the strings
- the string to writepublic void write1(byte[] b, int offset)
public void write1(byte[] b, int offset, int length)
public void write2(int j, int s)
public void write2(int j, byte[] b, int offset)
public void write2(int j, byte[] b, int offset, int length)
public void write2(int j, int[] s, int offset)
public void write2(int j, int[] s, int offset, int length)
public void write2(int j, java.lang.String s)
public void write2(byte[] b)
public void write2(int[] b)
public void write2(int s)
public void write2(byte[] b, int offset)
public void write2(byte[] b, int offset, int length)
public void write2(int[] s, int offset)
public void write2(int[] s, int offset, int length)
public void write2(java.lang.String s)
public void write4(int j, boolean b)
public void write4(int j, int i)
public void write4(int j, float f)
public void write4(int j, float[] f, int offset)
public void write4(int j, float[] f, int offset, int length)
public void write4(int j, int[] i, int offset)
public void write4(int j, int[] i, int offset, int length)
public void write4(float[] f)
public void write4(int[] i)
public void write4(float f)
public void write4(int i)
public void write4(float[] f, int offset)
public void write4(float[] f, int offset, int length)
public void write4(int[] i, int offset)
public void write4(int[] i, int offset, int length)
public void write8(int j, long l)
public void write8(int j, double d)
public void write8(int j, double[] d, int offset)
public void write8(int j, double[] d, int offset, int length)
public void write8(long l)
public void write8(double d)
public void write8(double[] d, int offset)
public void write8(double[] d, int offset, int length)
public void pad(int n)
n
- the number of bytes that have been written and need paddingpublic void write_unused(int i)
public void write1_unused()
public void write2_unused()
public void write3_unused()
public void write4_unused()
public static java.lang.String to_string(byte[] buffer, int offset, int length, java.lang.String prefix)
public static java.lang.String byte_to_string(int b)
public int n()
public int np()
public int p()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |