mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-09 22:51:22 +00:00
Fix for read() vs. readInstruction() issue. Consistency with placement of import vs. license
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.io;
|
||||
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -22,6 +19,9 @@ import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/**
|
||||
* Provides abstract and raw character read access to a stream of Guacamole
|
||||
* instructions.
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.io;
|
||||
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -22,6 +19,9 @@ import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/**
|
||||
* Provides abstract and raw character write access to a stream of Guacamole
|
||||
* instructions.
|
||||
|
@@ -1,12 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction.Operation;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -25,6 +19,12 @@ import net.sourceforge.guacamole.protocol.GuacamoleInstruction.Operation;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction.Operation;
|
||||
|
||||
/**
|
||||
* A GuacamoleReader which wraps a standard Java Reader, using that Reader as
|
||||
* the Guacamole instruction stream.
|
||||
@@ -54,6 +54,17 @@ public class ReaderGuacamoleReader implements GuacamoleReader {
|
||||
@Override
|
||||
public char[] read() throws GuacamoleException {
|
||||
|
||||
// If data was previously read via readInstruction(), return remaining
|
||||
// data instead of reading more.
|
||||
if (instructionBuffer != null) {
|
||||
|
||||
char[] chunk = new char[instructionBuffer.length - instructionStart];
|
||||
System.arraycopy(instructionBuffer, instructionStart, chunk, 0, chunk.length);
|
||||
instructionBuffer = null;
|
||||
|
||||
return chunk;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
// While we're blocking, or input is available
|
||||
|
@@ -1,11 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -24,6 +19,11 @@ import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/**
|
||||
* A GuacamoleWriter which wraps a standard Java Writer, using that Writer as
|
||||
* the Guacamole instruction stream.
|
||||
|
Reference in New Issue
Block a user