public class

ByteCodeHelper

extends Object
java.lang.Object
   ↳ org.hibernate.bytecode.util.ByteCodeHelper

Class Overview

A helper for reading byte code from various input sources.

Summary

Public Methods
static byte[] readByteCode(ZipInputStream zip)
Read class definition a zip (jar) file entry.
static 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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static byte[] readByteCode (ZipInputStream zip)

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.

public static byte[] readByteCode (File file)

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.

public static byte[] readByteCode (InputStream inputStream)

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 an IOException
Returns
  • The read bytes
Throws
IOException Indicates a problem accessing the given stream.