Created
September 3, 2015 17:58
-
-
Save lrytz/2a497020e8dfe01448a6 to your computer and use it in GitHub Desktop.
This file contains 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
def readClass(bytes: Array[Byte]): ClassNode = { | |
val node = new ClassNode() | |
new ClassReader(bytes).accept(node, Array[Attribute](InlineInfoAttributePrototype), 0) | |
node | |
} | |
def readClass(filename: String): ClassNode = { | |
val f = new java.io.RandomAccessFile(filename, "r") | |
val b = new Array[Byte](f.length.toInt) | |
f.read(b) | |
readClass(b) | |
} |
Author
lrytz
commented
Sep 3, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment