There are 1 code examples for java.nio.channels.FileChannel.MapMode.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: jnode-core Package: org.jnode.util
Source Code: JarBuffer.java (Click to view .java file)
Method Code:
public static void main(String[] args) throws SecurityException, IOException {
FileChannel ch=new FileInputStream(args[0]).getChannel();
ByteBuffer buf=ch.map(FileChannel.MapMode.READ_ONLY,0,ch.size());
JarBuffer jb=new JarBuffer(buf);
for ( Map.Entry<String,ByteBuffer> entry : jb.entries().entrySet()) {
final ByteBuffer ebuf=entry.getValue();
if (ebuf.limit() > 0) {
System.out.println(entry.getKey() + ' ' + ebuf.limit()+ " 0x"+ NumberUtils.hex(ebuf.getInt(0)));
}
}
}