Why does getResourceAsStream with an empty string return an empty InputStream?
===

I just came across some peculiar behavior with getResourceAsInputStream that I was hoping someone could shed some light on.

Passing this method the name of a nonexistent resource returns null, like I'd expect. However, passing it an empty or space-filled string actually returns a valid InputStream with zero bytes in it. Only empty or space-filled strings seem to do this; whitespace like "\t" or "\n" will result in a null.

Is this intended behavior? If so, what is it's purpose?

    this.class.getResourceAsStream("no_such_resource"); // returns null
    this.class.getResourceAsStream("");                 // returns an InputStream
    this.class.getResourceAsStream("    ");             // returns an InputStream
    this.class.getResourceAsStream("\t");               // returns null