public synchronized void close() {
        try {
            if (output != null) {
                output.close();
            }
            if (input != null) {
                input.close();
            }
        } catch (IOException ignore) {
        }
        if (process != null) {
            process.destroyForcibly();
            try {
                //TIKA-1933
                process.waitFor();
            } catch (InterruptedException e) {
                //swallow
            }
        }
        if (jar != null) {
            jar.delete();
        }
    }
Serializes the object first into an in-memory buffer and then
writes it to the output stream with a preceding size integer.

@param object    object to be serialized
@param resources list of fork resources, used when adding proxies
@throws IOException if the object could not be serialized
tika-core/src/main/java/org/apache/tika/fork/ForkClient.java