This code does returns null InputStream as well as null URL. Why is that? I have my own class that I want to get the actual .class file as an InputStream to serialize to bytes[].
Class clazz = String.class;
String className = clazz.getName(); System.out.println(className);
URL url = clazz.getResource(className);
if( url != null )
{
String pathName = url.getPath(); System.out.println(className);
}
InputStream inputStream = clazz.getResourceAsStream(className);
if(inputStream != null )
{
System.out.println(inputStream.available());
}