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

16
LINES

< > BotCompany Repo | #1033497 // bcelRoundtrip - .class to BCEL to .class

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

Uses 1311K of libraries. Click here for Pure Java version (4545L/25K).

1  
!include once #1019934 // BCEL
2  
3  
import org.apache.bcel.classfile.Attribute;
4  
import org.apache.bcel.classfile.SourceFile;
5  
import org.apache.bcel.generic.*;
6  
7  
static void bcelRoundtrip(InputStream classFile, S fileName, IVF1<ClassGen> modifier default null, OutputStream newClassFile) ctex {
8  
  JavaClass c = new ClassParser(classFile, fileName).parse();
9  
10  
  ClassGen g = new ClassGen(c);
11  
  
12  
  modifier?.get(g);
13  
  
14  
  c = g.getJavaClass();
15  
  c.dump(newClassFile);
16  
}

Author comment

Began life as a copy of #1004069

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033497
Snippet name: bcelRoundtrip - .class to BCEL to .class
Eternal ID of this version: #1033497/6
Text MD5: 1757a8fba3fdd9eba62abbe93fa25b8e
Transpilation MD5: 510f7f2edc49a6695360d824860e9fe5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-29 07:12:30
Source code size: 474 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 157 / 221
Version history: 5 change(s)
Referenced in: [show references]