@SuppressWarnings("unchecked")
  public static <T extends Serializable> T fromBytes(byte[] bytes, Object... args) {
    ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
    final Object[] stack = SerializationProxy.swapExtraArguments(args);
    try (ObjectInput ois = new ObjectInputStream(bis)) {
      return (T) ois.readObject();
    } catch (IOException | ClassNotFoundException | ClassCastException xany) {
      throw ProxyException.convert(xany);
    } finally {
      SerializationProxy.swapExtraArguments(stack);
    }
  }
Materialize a serializable object from an array of bytes.
@param bytes the bytes
@param args the proxy arguments
@return the object
@throws ProxyException on any underlying error
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/SerializationProxy.java