private GuacamoleInstruction handleBlob(GuacamoleInstruction instruction) {

        // Verify all required arguments are present
        List<String> args = instruction.getArgs();
        if (args.size() < 2)
            return instruction;

        // Pull associated stream
        String index = args.get(0);
        InterceptedStream<OutputStream> stream = getInterceptedStream(index);
        if (stream == null)
            return instruction;

        // Decode blob
        byte[] blob;
        try {
            String data = args.get(1);
            blob = BaseEncoding.base64().decode(data);
        }
        catch (IllegalArgumentException e) {
            logger.warn("Received base64 data for intercepted stream was invalid.");
            logger.debug("Decoding base64 data for intercepted stream failed.", e);
            return null;
        }

        try {

            // Attempt to write data to stream
            stream.getStream().write(blob);

            // Force client to respond with their own "ack" if we need to
            // confirm that they are not falling behind with respect to the
            // graphical session
            if (!acknowledgeBlobs) {
                acknowledgeBlobs = true;
                return new GuacamoleInstruction("blob", index, "");
            }

            // Otherwise, acknowledge the blob on the client's behalf
            sendAck(index, "OK", GuacamoleStatus.SUCCESS);

        }
        catch (IOException e) {
            sendAck(index, "FAIL", GuacamoleStatus.SERVER_ERROR);
            logger.debug("Write failed for intercepted stream.", e);
        }

        // Instruction was handled purely internally
        return null;

    }
Handles a single "blob" instruction, decoding its base64 data,
sending that data to the associated OutputStream, and ultimately
dropping the "blob" instruction such that the client never receives
it. If no OutputStream is associated with the stream index within
the "blob" instruction, the instruction is passed through untouched.

@param instruction
    The "blob" instruction being handled.

@return
    The originally-provided "blob" instruction, if that instruction
    should be passed through to the client, or null if the "blob"
    instruction should be dropped.
guacamole/src/main/java/org/apache/guacamole/tunnel/OutputStreamInterceptingFilter.java