Package org.apache.guacamole.io
Interface GuacamoleReader
-
- All Known Implementing Classes:
FilteredGuacamoleReader
,ReaderGuacamoleReader
public interface GuacamoleReader
Provides abstract and raw character read access to a stream of Guacamole instructions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
available()
Returns whether instruction data is available for reading.char[]
read()
Reads at least one complete Guacamole instruction, returning a buffer containing one or more complete Guacamole instructions and no incomplete Guacamole instructions.GuacamoleInstruction
readInstruction()
Reads exactly one complete Guacamole instruction and returns the fully parsed instruction.
-
-
-
Method Detail
-
available
boolean available() throws GuacamoleException
Returns whether instruction data is available for reading. Note that this does not guarantee an entire instruction is available. If a full instruction is not available, this function can return true, and a call to read() will still block.- Returns:
- true if instruction data is available for reading, false otherwise.
- Throws:
GuacamoleException
- If an error occurs while checking for available data.
-
read
char[] read() throws GuacamoleException
Reads at least one complete Guacamole instruction, returning a buffer containing one or more complete Guacamole instructions and no incomplete Guacamole instructions. This function will block until at least one complete instruction is available.- Returns:
- A buffer containing at least one complete Guacamole instruction, or null if no more instructions are available for reading.
- Throws:
GuacamoleException
- If an error occurs while reading from the stream.
-
readInstruction
GuacamoleInstruction readInstruction() throws GuacamoleException
Reads exactly one complete Guacamole instruction and returns the fully parsed instruction.- Returns:
- The next complete instruction from the stream, fully parsed, or null if no more instructions are available for reading.
- Throws:
GuacamoleException
- If an error occurs while reading from the stream, or if the instruction cannot be parsed.
-
-