Package org.hibernate.bytecode.spi
Class ByteCodeHelper
- java.lang.Object
-
- org.hibernate.bytecode.spi.ByteCodeHelper
-
public class ByteCodeHelper extends java.lang.ObjectA helper for reading byte code from various input sources.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]readByteCode(java.io.File file)Read class definition from a file.static byte[]readByteCode(java.io.InputStream inputStream)Reads class byte array info from the given input stream.static byte[]readByteCode(java.util.zip.ZipInputStream zip)Read class definition a zip (jar) file entry.
-
-
-
Method Detail
-
readByteCode
public static byte[] readByteCode(java.io.InputStream inputStream) throws java.io.IOExceptionReads 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:
java.io.IOException- Indicates a problem accessing the given stream.
-
readByteCode
public static byte[] readByteCode(java.io.File file) throws java.io.IOExceptionRead class definition from a file.- Parameters:
file- The file to read.- Returns:
- The class bytes
- Throws:
java.io.IOException- Indicates a problem accessing the given stream.
-
readByteCode
public static byte[] readByteCode(java.util.zip.ZipInputStream zip) throws java.io.IOExceptionRead class definition a zip (jar) file entry.- Parameters:
zip- The zip entry stream.- Returns:
- The class bytes
- Throws:
java.io.IOException- Indicates a problem accessing the given stream.
-
-