PIRL.Utilities

## Class Streams

- java.lang.Object
- - PIRL.Utilities.Streams

    public class Streams
    extends Object

The Streams class provides a collection of methods for handling I/O streams.

### Field Summary

Fields
`static String` `ID`

### Method Summary

Methods
`static ImageInputStream` `Get_Image_Stream(String source)` Obtain an ImageInputStream from a named source.
`static InputStream` `Get_Stream(String source)` Obtain an InputStream from a named source.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### ID

    public static final String ID

See Also:
  Constant Field Values

### Method Detail

#### Get_Stream

    public static InputStream Get_Stream(String source)

Obtain an InputStream from a named source.

The source String is first treated as a URL specification. If this fails the source is treated as a pathname to a locally accessible file. If no file is found the source is treated as the name of a system resource, which can find a file inside a jar file when the application is being run from a jar.

Parameters:
  `source` - The name of a stream source.
Returns:
  An InputStream, or null if no source file can be found.

#### Get_Image_Stream

    public static ImageInputStream Get_Image_Stream(String source)

Obtain an ImageInputStream from a named source.

If a URL can be constructed from the source String an attempt is made to construct an HTTP_ImageInputStream from the URL. If the source is not a valid URL, the source is treated as a pathname to a locally accessible file and an attempt is made to construct a FileImageInputStream from the File.

Parameters:
  `source` - The name of a stream source.
Returns:
  An ImageInputStream, or null if no source is accessible.