Module jp.cafebabe.kunai

The module jp.cafebabe.kunai handles the reading and writing the class files.

The reading supports from local files, directories, jar/war files as the DataSource. The writing supports to local files, directories, jar files by representing DataSink.

The below program is an example program for copying reading source to the destination (it assumes local files).

 public void copy(String from, String to) throws Exception {
     try(DataSource source = new DefaultDataSourceFactory().build(Paths.get(from));
             DataSink sink = new DefaultDataSinkFactory().create(Paths.get(to))){
         copy(source, sink);
     }
 }
 public void copy(DataSource source, DataSink sink) throws Exception {
     sink.consume(source);
 }
 
Author:
Haruaki Tamada