net.metanotion.io
Class JInputStream

java.lang.Object
  extended by net.metanotion.io.JInputStream
All Implemented Interfaces:
Closeable, InputStream

public final class JInputStream
extends Object
implements InputStream

Adapter to convert a java.io.InputStream into a net.metantion.io.InputStream.


Constructor Summary
JInputStream(InputStream in)
           
 
Method Summary
 boolean atEOF()
           
 void close()
           
 byte read()
          Reads the next byte of data from the stream.
 int read(byte[] b)
           
 int read(byte[] b, int offset, int length)
           
 long skip(long n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JInputStream

public JInputStream(InputStream in)
Method Detail

read

public int read(byte[] b)
Specified by:
read in interface InputStream

read

public int read(byte[] b,
                int offset,
                int length)
Specified by:
read in interface InputStream

read

public byte read()
Description copied from interface: InputStream
Reads the next byte of data from the stream. If the end of the stream has been reached, a runtime exception is thrown. This method blocks until data is available or an exception is thrown.

Specified by:
read in interface InputStream
Returns:
Next byte in the input stream.

skip

public long skip(long n)
Specified by:
skip in interface InputStream

atEOF

public boolean atEOF()
Specified by:
atEOF in interface InputStream

close

public void close()
Specified by:
close in interface Closeable
Specified by:
close in interface InputStream