|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgcspy.comm.BufferedOutput
public class BufferedOutput
Buffered output to a byte array The communication stream has the following wire format (b is a byte)
byte b ubyte b short bb ushort bb false 0 true 1 int bbbb string byte...byte0 len int array len item...item color ubyte ubyte ubyte
Constructor Summary | |
---|---|
BufferedOutput(byte[] buffer)
Create a new output buffer |
Method Summary | |
---|---|
void |
close()
Close the buffer |
int |
getLen()
Get the current length of the buffer |
void |
writeArrayLen(int len)
Write an array's length into the buffer |
void |
writeBoolean(boolean b)
Write a boolean into the buffer |
void |
writeByte(byte v)
Write a byte into the buffer |
void |
writeByteArray(byte[] v)
Write a array of bytes into the buffer, preceded by its length |
void |
writeByteArray(byte[] v,
int len)
Write a prefix of array of bytes into the buffer, preceded by its length |
void |
writeColor(java.awt.Color c)
Write a colour into the buffer |
void |
writeEmptyArray()
Write a zero-length array into the buffer |
void |
writeInt(int v)
Write an int into the buffer |
void |
writeIntArray(int[] v)
Write a array of ints into the buffer, preceded by its length |
void |
writeIntArray(int[] v,
int len)
Write a prefix of array of ins into the buffer, preceded by its length |
void |
writeShort(int v)
Write a short into the buffer |
void |
writeShortArray(short[] v)
Write a array of shorts into the buffer, preceded by its length |
void |
writeShortArray(short[] v,
int len)
Write a prefix of array of shorts into the buffer, preceded by its length |
void |
writeString(java.lang.String v)
Write a string into the buffer, terminated by 0. |
void |
writeUByte(short v)
Write an unsigned into the buffer |
void |
writeUByteArray(short[] v)
Write a array of unsigned bytes into the buffer, preceded by its length |
void |
writeUByteArray(short[] v,
int len)
Write a prefix of array of unsigned bytes into the buffer, preceded by its length |
void |
writeUShort(int v)
Write an unsigned short into the buffer |
void |
writeUShortArray(int[] v)
Write a array of unsigned shorts into the buffer, preceded by its length |
void |
writeUShortArray(int[] v,
int len)
Write a prefix of array of unsigned shorts into the buffer, preceded by its length |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BufferedOutput(byte[] buffer)
buffer
- the bufferMethod Detail |
---|
public int getLen()
public void writeBoolean(boolean b)
b
- The value to writepublic void writeByte(byte v)
v
- The value to writepublic void writeUByte(short v)
v
- The value to writepublic void writeShort(int v)
v
- The value to writepublic void writeUShort(int v)
v
- The value to writepublic void writeInt(int v)
v
- The value to writepublic void writeString(java.lang.String v)
v
- The string to writepublic void writeArrayLen(int len)
len
- the length to writepublic void writeByteArray(byte[] v)
v
- the array to writepublic void writeByteArray(byte[] v, int len)
v
- the arraylen
- the number of bytes to writepublic void writeUByteArray(short[] v)
v
- the array to writepublic void writeUByteArray(short[] v, int len)
v
- the arraylen
- the number of bytes to writepublic void writeShortArray(short[] v)
v
- the array to writepublic void writeShortArray(short[] v, int len)
v
- the arraylen
- the number of bytes to writepublic void writeUShortArray(int[] v)
v
- the array to writepublic void writeUShortArray(int[] v, int len)
v
- the arraylen
- the number of bytes to writepublic void writeIntArray(int[] v)
v
- the array to writepublic void writeIntArray(int[] v, int len)
v
- the arraylen
- the number of bytes to writepublic void writeEmptyArray()
public void writeColor(java.awt.Color c)
c
- The colour to writepublic void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |