Last active
April 16, 2022 19:33
-
-
Save XiaoPangxie732/5805cd7926941b3b1d5c8efc1bd80264 to your computer and use it in GitHub Desktop.
things may be useful
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static byte[] readFileUsingFileChannelAndMappedByteBuffer(Path file) { | |
try(FileChannel ch = FileChannel.open(file, StandardOpenOption.READ)) { | |
MappedByteBuffer mbb = ch.map(FileChannel.MapMode.READ_ONLY, 0, ch.size()); | |
byte[] bytes = new byte[mbb.remaining()]; | |
mbb.get(bytes); | |
return bytes; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jvm method descriptor: ^\((\[*([ZBCDFIJS]|L([A-Za-z_]+\w*[/$]?)+;))*\)\[*([ZBCDFIJSV]|L([A-Za-z_]+\w*[/$]?)+;)$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment