public final <E extends T> E read(InputStream in, Object... args) {
    if (in != null) {
      ObjectInput ois = null;
      Object[] stack = SerializationProxy.swapExtraArguments(args);
      try {
        ois = in instanceof ObjectInputStream? (ObjectInputStream) in : new ObjectInputStream(in);
        @SuppressWarnings("unchecked")
        E t = (E) ois.readObject();
        return t;
      } catch (ClassCastException | ClassNotFoundException | IOException xany) {
        readError(xany, "error reading " + in);
      } finally {
        SerializationProxy.swapExtraArguments(stack);
        if (ois != null) {
          try {
            ois.close();
          } catch (IOException xio) {
            readWarning(xio, "closing object stream: ");
          }
        }
      }
    }
    return null;
  }
Loads an object from the persistent storage.

@param <E> the class of the object to read
@param in   the stream to read from
@param args the proxy arguments
@return the object or null if file is null
@throws SerializationProxy.ProxyException in case of low level error
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/Serializer.java