package java.lang {
import flash.system.ApplicationDomain;
import java.io.InputStream;
import java.io.ByteArrayInputStream;
import java.lang.Arguments;
import java.lang.JavaArray;
dynamic public class ClassLoader {
  public static function createArray__Ljava_lang_Object_2(cls: Object): JavaArray {
    import flash.utils.*;
    var array : ByteArray = new cls();
    var result:JavaArray = new JavaArray("[B");
    result.array = array;
    return result;
  }
  public static function getSystemResourceAsStream__Ljava_lang_String_2(name: String): InputStream {
    if (name === null)
      throw new NullPointerException(new Arguments(java.lang.NullPointerException.NullPointerException__, []));
    name = "Resources_" + mangleResourceName__Ljava_lang_String_2(name);
    if (!ApplicationDomain.currentDomain.hasDefinition(name))
      return null;
    var clazz: Object = ApplicationDomain.currentDomain.getDefinition(name);
    if (clazz === null)
      return null;
    var resource: JavaArray = createArray__Ljava_lang_Object_2(clazz);
    return new ByteArrayInputStream(new Arguments(java.io.ByteArrayInputStream.ByteArrayInputStream___3B, [resource]));
  }
  public static function mangleResourceName__Ljava_lang_String_2(tempString: String): String {
    var mangledName: String = Object(tempString).replace__CC(32, 95);
    mangledName = Object(mangledName).replace__CC(47, 95);
    mangledName = Object(mangledName).replace__CC(46, 95);
    mangledName = Object(mangledName).replace__CC(45, 95);
    return mangledName;
  }
}
}
