Package org.hibernate.bytecode.util
Class ByteCodeHelper
java.lang.Object
org.hibernate.bytecode.util.ByteCodeHelper
A helper for reading byte code from various input sources.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]readByteCode(File file) Read class definition from a file.static byte[]readByteCode(InputStream inputStream) Reads class byte array info from the given input stream.static byte[]Read class definition a zip (jar) file entry.
-
Method Details
-
readByteCode
Reads class byte array info from the given input stream. The stream is closed within this method!- Parameters:
inputStream- The stream containing the class binary; null will lead to anIOException- Returns:
- The read bytes
- Throws:
IOException- Indicates a problem accessing the given stream.
-
readByteCode
Read class definition from a file.- Parameters:
file- The file to read.- Returns:
- The class bytes
- Throws:
IOException- Indicates a problem accessing the given stream.
-
readByteCode
Read class definition a zip (jar) file entry.- Parameters:
zip- The zip entry stream.- Returns:
- The class bytes
- Throws:
IOException- Indicates a problem accessing the given stream.
-