private Object readObject(ClassLoader loader) throws IOException, ClassNotFoundException {
        Object object = ForkObjectInputStream.readObject(input, loader);
        if (object instanceof ForkProxy) {
            ((ForkProxy) object).init(input, output);
        }

        // Tell the parent process that we successfully received this object
        output.writeByte(ForkServer.DONE);
        output.flush();

        return object;
    }
Deserializes an object from the given stream. The serialized object
is expected to be preceded by a size integer, that is used for reading
the entire serialization into a memory before deserializing it.

@param loader class loader to be used for loading referenced classes
@throws IOException            if the object could not be deserialized
@throws ClassNotFoundException if a referenced class is not found
tika-core/src/main/java/org/apache/tika/fork/ForkServer.java