github.com/projectdiscovery/nuclei/v2@v2.9.15/pkg/protocols/common/helpers/deserialization/testdata/Deserialize.java (about)

     1  import java.io.*;
     2  
     3  class Deserialize {  
     4      public static void main(String args[]) {
     5          FileInputStream fileIn = null;
     6          ObjectInputStream in = null;
     7          ValueObject vo2 = null;
     8  
     9          try {
    10              fileIn = new FileInputStream("ValueObject2.ser");
    11          }
    12          catch(FileNotFoundException e) {
    13              e.printStackTrace();
    14          }
    15  
    16         try {
    17              in = new ObjectInputStream(fileIn);
    18          }
    19          catch(IOException e) {
    20              e.printStackTrace();
    21          }
    22          try {
    23              vo2 = (ValueObject) in.readObject();
    24          }
    25          catch(Exception e) {
    26              e.printStackTrace();
    27          }
    28          System.out.println(vo2);
    29      }
    30  }