mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-09 22:51:22 +00:00
Removed trailing whitespace.
This commit is contained in:
@@ -53,14 +53,14 @@ public interface GuacamoleReader {
|
||||
* 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.
|
||||
*
|
||||
*
|
||||
* @return true if instruction data is available for reading, false
|
||||
* otherwise.
|
||||
* @throws GuacamoleException If an error occurs while checking for
|
||||
* available data.
|
||||
*/
|
||||
public boolean available() throws GuacamoleException;
|
||||
|
||||
|
||||
/**
|
||||
* Reads at least one complete Guacamole instruction, returning a buffer
|
||||
* containing one or more complete Guacamole instructions and no
|
||||
|
@@ -93,7 +93,7 @@ public class ReaderGuacamoleReader implements GuacamoleReader {
|
||||
|
||||
// Length of element
|
||||
int elementLength = 0;
|
||||
|
||||
|
||||
// Resume where we left off
|
||||
int i = parseStart;
|
||||
|
||||
@@ -115,7 +115,7 @@ public class ReaderGuacamoleReader implements GuacamoleReader {
|
||||
|
||||
// Get terminator
|
||||
char terminator = buffer[i + elementLength];
|
||||
|
||||
|
||||
// Move to character after terminator
|
||||
i += elementLength + 1;
|
||||
|
||||
@@ -139,19 +139,19 @@ public class ReaderGuacamoleReader implements GuacamoleReader {
|
||||
System.arraycopy(buffer, i, buffer, 0, usedLength);
|
||||
|
||||
return instruction;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Handle invalid terminator characters
|
||||
else if (terminator != ',')
|
||||
throw new GuacamoleServerException("Element terminator of instruction was not ';' nor ','");
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Otherwise, read more data
|
||||
else
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Otherwise, parse error
|
||||
@@ -189,14 +189,14 @@ public class ReaderGuacamoleReader implements GuacamoleReader {
|
||||
|
||||
// Get instruction
|
||||
char[] instructionBuffer = read();
|
||||
|
||||
|
||||
// If EOF, return EOF
|
||||
if (instructionBuffer == null)
|
||||
return null;
|
||||
|
||||
|
||||
// Start of element
|
||||
int elementStart = 0;
|
||||
|
||||
|
||||
// Build list of elements
|
||||
LinkedList<String> elements = new LinkedList<String>();
|
||||
while (elementStart < instructionBuffer.length) {
|
||||
@@ -232,14 +232,14 @@ public class ReaderGuacamoleReader implements GuacamoleReader {
|
||||
|
||||
// Append element to list of elements
|
||||
elements.addLast(element);
|
||||
|
||||
|
||||
// Read terminator after element
|
||||
elementStart += length;
|
||||
char terminator = instructionBuffer[elementStart];
|
||||
|
||||
// Continue reading instructions after terminator
|
||||
elementStart++;
|
||||
|
||||
|
||||
// If we've reached the end of the instruction
|
||||
if (terminator == ';')
|
||||
break;
|
||||
@@ -248,7 +248,7 @@ public class ReaderGuacamoleReader implements GuacamoleReader {
|
||||
|
||||
// Pull opcode off elements list
|
||||
String opcode = elements.removeFirst();
|
||||
|
||||
|
||||
// Create instruction
|
||||
GuacamoleInstruction instruction = new GuacamoleInstruction(
|
||||
Operation.fromOpcode(opcode),
|
||||
|
Reference in New Issue
Block a user