Class SimplePatcher

java.lang.Object
one.tranic.t.utils.SimplePatcher

@Experimental public class SimplePatcher extends Object
  • Constructor Details

    • SimplePatcher

      public SimplePatcher()
  • Method Details

    • createPatch

      public static OutputStream createPatch(InputStream src, InputStream dst) throws IOException
      Creates a binary patch that transforms the contents of the source file into the destination file.
      Parameters:
      src - the InputStream representing the source file's data
      dst - the InputStream representing the destination file's data
      Returns:
      an OutputStream containing the binary patch data
      Throws:
      IOException - if an I/O error occurs while reading from the input streams or writing to the patch
    • applyPatch

      public static OutputStream applyPatch(InputStream patch, InputStream dst) throws IOException
      Applies a patch to a target file and returns the resulting file as an output stream.
      Parameters:
      patch - the input stream containing the patch data to be applied
      dst - the input stream of the target file that will be patched
      Returns:
      an output stream containing the patched file contents
      Throws:
      IOException - if an I/O error occurs while reading or writing streams
      IllegalStateException - if the patch does not match the target file, is corrupted, or contains invalid commands