org.extex.resource.io
Class NamedInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.extex.resource.io.NamedInputStream
All Implemented Interfaces:
java.io.Closeable

public class NamedInputStream
extends java.io.InputStream

This input stream carries a name to transport the information where the input is coming from.

Version:
$Revision$
Author:
Gerd Neugebauer

Constructor Summary
NamedInputStream(java.io.InputStream stream, java.lang.String name)
          Creates a new object.
 
Method Summary
 int available()
          
 void close()
          
 boolean equals(java.lang.Object obj)
          
 java.lang.String getName()
          Getter for name.
 int hashCode()
          
 void mark(int readlimit)
          
 boolean markSupported()
          
 int read()
          
 int read(byte[] b)
          
 int read(byte[] b, int off, int len)
          
 void reset()
          
 long skip(long n)
          
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamedInputStream

public NamedInputStream(java.io.InputStream stream,
                        java.lang.String name)
Creates a new object.

Parameters:
stream - the stream
name - the name
Method Detail

available

public int available()
              throws java.io.IOException

Overrides:
available in class java.io.InputStream
Throws:
java.io.IOException
See Also:
InputStream.available()

close

public void close()
           throws java.io.IOException

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException
See Also:
InputStream.close()

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getName

public java.lang.String getName()
Getter for name.

Returns:
the name

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

mark

public void mark(int readlimit)

Overrides:
mark in class java.io.InputStream
See Also:
InputStream.mark(int)

markSupported

public boolean markSupported()

Overrides:
markSupported in class java.io.InputStream
See Also:
InputStream.markSupported()

read

public int read()
         throws java.io.IOException

Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException
See Also:
InputStream.read()

read

public int read(byte[] b)
         throws java.io.IOException

Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException
See Also:
InputStream.read(byte[])

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException

Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException
See Also:
InputStream.read(byte[], int, int)

reset

public void reset()
           throws java.io.IOException

Overrides:
reset in class java.io.InputStream
Throws:
java.io.IOException
See Also:
InputStream.reset()

skip

public long skip(long n)
          throws java.io.IOException

Overrides:
skip in class java.io.InputStream
Throws:
java.io.IOException
See Also:
InputStream.skip(long)

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()