|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
gnu.x11.RequestOutputStream
public class RequestOutputStream
Used to create and manage requests to the X server.
| Nested Class Summary | |
|---|---|
static class |
RequestOutputStream.SendMode
|
| Field Summary | |
|---|---|
byte[] |
buffer
The request buffer. |
int |
index
The current write index in the buffer. |
RequestObject |
request_object
The request object. |
int |
seq_number
|
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Method Summary | |
|---|---|
void |
begin_request(int opcode,
int second_field,
int request_length)
Begins a new request. |
int |
current_opcode()
Returns the opcode of the current request. |
boolean |
fits(int num_bytes)
Determines if the buffer has room for the specified number of bytes. |
void |
flush()
Flushes all the pending request data to the underlying stream. |
int |
get_int32(int index)
Returns the INT32 value at the specified index in the buffer inside the current request. |
void |
increase_length(int i)
|
int |
opcode()
Returns the opcode of the current request or -1 if there is no request pending. |
static int |
pad(int n)
Returns the number of bytes that are needed to pad n bytes
to fill a multiple of four. |
void |
send()
Sends the current request to the underlying stream, without necessarily flushing the stream. |
int |
set_buffer_size(int size)
Changes the buffer size. |
void |
set_index(int i)
Sets the write index to i. |
long |
skip(long n)
|
void |
update_length()
Updates the length field of the request to reflect the current length. |
void |
write_bool(boolean b)
|
void |
write_bytes(byte[] b)
|
void |
write_double(double d)
|
void |
write_float(float f)
|
void |
write_int16(int v)
Writes an INT16 value to the stream. |
void |
write_int32(int v)
Writes an INT32 value to the stream. |
void |
write_int8(int v)
Writes an INT8 value to the stream. |
void |
write_pad(int n)
Skips p unused bytes, where p is pad(n). pad(n) is the number of bytes that are needed to fill a block multiple of 4. |
void |
write_string16(java.lang.String s)
Writes a STRING16 to the stream. |
void |
write_string8(java.lang.String s)
Writes a STRING8 value to the stream. |
void |
write(byte[] b)
Writes the specified data to the stream. |
void |
write(byte[] b,
int offs,
int len)
Writes the specified data to the stream. |
void |
write(int v)
Writes one byte to the stream. |
| Methods inherited from class java.io.FilterOutputStream |
|---|
close |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public byte[] buffer
public int index
public RequestObject request_object
public int seq_number
| Method Detail |
|---|
public int set_buffer_size(int size)
size - the new buffer size
public void begin_request(int opcode,
int second_field,
int request_length)
opcode - the opcode for the requestsecond_field - the second field for the requestrequest_length - the length of the requestpublic void send()
public int current_opcode()
public void set_index(int i)
i.
i - the write index to set
public void write(int v)
throws java.io.IOException
write in class java.io.FilterOutputStreamv -
java.io.IOExceptionpublic void write(byte[] b)
write in class java.io.FilterOutputStreamb - the data to write
public void write(byte[] b,
int offs,
int len)
write in class java.io.FilterOutputStreamb - the data to writeoffs - the start offset in the data arraylen - the length of the data to writepublic void flush()
flush in interface java.io.Flushableflush in class java.io.FilterOutputStreampublic void write_bool(boolean b)
public void write_int8(int v)
v - the value to writepublic void write_int16(int v)
v - the value to writepublic void write_int32(int v)
v - the value to writepublic int get_int32(int index)
index - the index
public void write_float(float f)
public void write_double(double d)
public void write_string8(java.lang.String s)
s - the string to writepublic void write_string16(java.lang.String s)
s - the string to writepublic void write_bytes(byte[] b)
public long skip(long n)
public void write_pad(int n)
n - the number to be paddedpublic static int pad(int n)
n bytes
to fill a multiple of four.
n - the number of bytes the pad
public int opcode()
public boolean fits(int num_bytes)
num_bytes - the number of bytes
true if the buffer has space for the specified number
of bytes, false otherwisepublic void update_length()
public void increase_length(int i)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||