private Object getPrivilegedStream(final boolean output) {
        try {
            final Value value = this;
            return AccessController.doPrivileged(new PrivilegedExceptionAction() {
                public Object run() throws IOException {
                    if (output)
                        return new ValueObjectOutputStream(value);
                    else
                        return new ValueObjectInputStream(value);
                }
            });
        } catch (PrivilegedActionException pae) {
            throw new ConversionException("While creating "
                    + (output ? "ValueObjectOutputStream" : "ValueObjectInputStream"), pae.getException());
        }
    }