java.lang.Object
io.github.sugarcubes.cloner.enhancement.ClassFiles
Reading of class files on JDK 8.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intmajorVersion(byte[] bytes) Returns the major version of a class file.static byte[]readAll(InputStream in) Reads the stream fully,InputStream.readAllBytes()appeared in JDK 9.
-
Method Details
-
majorVersion
public static int majorVersion(byte[] bytes) Returns the major version of a class file.- Parameters:
bytes- class file- Returns:
- major version, e.g.
52for Java 8
-
readAll
Reads the stream fully,InputStream.readAllBytes()appeared in JDK 9.- Parameters:
in- stream- Returns:
- bytes
- Throws:
IOException- if reading fails
-