All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.builder.resolver.ResourceInputStream
java.lang.Object
|
+----java.io.InputStream
|
+----java.io.FilterInputStream
|
+----java.io.DataInputStream
|
+----com.sun.wizards.builder.resolver.ResourceInputStream
- public class ResourceInputStream
- extends DataInputStream
This class represents a resource entry in the memory of the VM.
When a ResourceResolver resolves a resource, this is what is
created and returned for callers to use to access the resource.
You can query the resource to get properties of the resource, or
read the stream itself to read the resource contents.
-
ResourceInputStream(DataInputStream, long)
- Creates a new ResourceInputStream and initializes the
properties of the resource.
-
getLength()
- Returns the length of the resource.
ResourceInputStream
public ResourceInputStream(DataInputStream resource,
long length)
- Creates a new ResourceInputStream and initializes the
properties of the resource.
- Parameters:
- resource - The stream that can be used to directly read
the resource. There is no header information in the stream.
Creators of a ResourceInputStream should correctly position
this argument so that reading
length bytes from
the stream would get the entire resource. Once callers read
the bytes from the stream, the close() method should be called
to avoid unnecessary system resources being allocated and wasted.
- length - The length of the resource. Creators of this
stream should provide the length of the resource contained
in the stream.
getLength
public long getLength()
- Returns the length of the resource. Reading this amount of
bytes from the stream would result in reading the entire resource.
- Returns:
- The length of the resource, in bytes.
All Packages Class Hierarchy This Package Previous Next Index