@Override
    public void write(char[] chunk, int off, int len) throws GuacamoleException {
        try {
            output.write(chunk, off, len);
            output.flush();
        }
        catch (SocketTimeoutException e) {
            throw new GuacamoleUpstreamTimeoutException("Connection to guacd timed out.", e);
        }
        catch (SocketException e) {
            throw new GuacamoleConnectionClosedException("Connection to guacd is closed.", e);
        }
        catch (IOException e) {
            throw new GuacamoleServerException(e);
        }
    }
Creates a new WriterGuacamoleWriter which will use the given Writer as
the Guacamole instruction stream.

@param output The Writer to use as the Guacamole instruction stream.
guacamole-common/src/main/java/org/apache/guacamole/io/WriterGuacamoleWriter.java