code: public static ExecutionPlan getExecutionPlanFromBytes(byte[] bytes) {
  
          try (ByteArrayInputStream is = new ByteArrayInputStream(bytes);
               BufferedInputStream bis = new BufferedInputStream(is);
               GZIPInputStream gis = new GZIPInputStream(bis);
               BufferedInputStream bis_2 = new BufferedInputStream(gis);
               ObjectInputStream ois = new ObjectInputStream(bis_2);
          ) {
  
              return (ExecutionPlan) ois.readObject();
  
          } catch (IOException | ClassNotFoundException ex) {
              logger.error("Failed to read execution plan from byte[]. Error: ", ex);
              throw new RuntimeException("Failed to read execution plan from byte[]. Error: ", ex);
          }
    }
docs: Gets byte[] that contains serialized object ExecutionPlan + zipped
  and creates ExecutionPlan from it
  
  @param bytes - compressed serialized object of ExecutionPlan
  @return ExecutionPlan