I just came across some kind of peculiar behavior with getResourceAsInputStream that I was hoping someone could shed some light on.
By passing this method, the name of a nonexistent resource returns zero, as I expected. However, passing it an empty or space-filled string actually returns a valid InputStream with zero bytes in it. These appear to be empty or blank spaces; spaces like "\ t" or "\ n" will result in a null value.
Is this the intended behavior? If so, what is the purpose?
this.class.getResourceAsStream("no_such_resource");
this.class.getResourceAsStream("");
this.class.getResourceAsStream(" ");
this.class.getResourceAsStream("\t");
source
share