Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1033514 // replaceFileZip2Zip

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4866L/27K).

svoid replaceFileZip2Zip(File inZip, File outZip,
  S toReplace, byte[] newContents) {
  
  Zip2Zip z2z = new(inZip, outZip);
  z2z.copyFileContents = (name, in, out) -> {
    if (eq(name, toReplace)) {
      print("REPLACING " + name);
      ctex {
        out.write(newContents);
      }
    } else
      copyStream(in, out);
  };
  z2z.run();
}

Author comment

Began life as a copy of #1033499

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033514
Snippet name: replaceFileZip2Zip
Eternal ID of this version: #1033514/2
Text MD5: a4c3be50b4e479b60c9efce56412b5e9
Transpilation MD5: ea6fa89b100e8ea57d12829a3617f45e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-29 09:18:03
Source code size: 361 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 142 / 199
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)