org.allcolor.yahp.converter
Class CJarLoaderURLStreamHandler
java.lang.Object
java.net.URLStreamHandler
org.allcolor.yahp.converter.CJarLoaderURLStreamHandler
public class CJarLoaderURLStreamHandler
- extends java.net.URLStreamHandler
Methods inherited from class java.net.URLStreamHandler |
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
handler
private static CJarLoaderURLStreamHandler handler
preload
private java.util.Map preload
- preload byte class map
CJarLoaderURLStreamHandler
public CJarLoaderURLStreamHandler()
getInstance
public static CJarLoaderURLStreamHandler getInstance()
addClassPreload
public void addClassPreload(java.lang.String path,
byte[] array)
- add a class byte representation in the preload map
- Parameters:
path
- path to the class inside the jararray
- byte representation
loadByteArray
public static final byte[] loadByteArray(java.io.InputStream in)
- load the given inputstream in a byte array
- Parameters:
in
- the stream to load
- Returns:
- a byte array
loadByteArray
public static final byte[] loadByteArray(java.net.URL urlToResource)
- load the given url in a byte array
- Parameters:
urlToResource
- url to load
- Returns:
- a byte array
openConnection
protected java.net.URLConnection openConnection(java.net.URL u)
throws java.io.IOException
- Specified by:
openConnection
in class java.net.URLStreamHandler
- Throws:
java.io.IOException