ist.palcom.storage.pio
Class StorageInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by ist.palcom.storage.pio.StorageInputStream
All Implemented Interfaces:
java.io.Closeable

public class StorageInputStream
extends java.io.InputStream


Constructor Summary
StorageInputStream(Storage store, java.lang.String filen)
          Creat an input stream
 
Method Summary
 void close()
          Close an input stream
 void open(java.lang.String filen)
          Open an input stream
 int read()
          Read from the input stream
 int read(byte[] b, int off, int len)
          Read from the input stream
 int readInt()
          Read an int from the input stream
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StorageInputStream

public StorageInputStream(Storage store,
                          java.lang.String filen)
                   throws java.io.IOException
Creat an input stream

Parameters:
store - the Storage
filen - the File name
Throws:
java.io.IOException
Method Detail

open

public void open(java.lang.String filen)
          throws java.io.IOException
Open an input stream

Parameters:
filen - the Storage
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Close an input stream

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Read from the input stream

Specified by:
read in class java.io.InputStream
Returns:
an int
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Read from the input stream

Overrides:
read in class java.io.InputStream
Parameters:
b - the byte array to store
off - the offset
len - the length of the byte array
Returns:
how many bytes that was read
Throws:
java.io.IOException

readInt

public int readInt()
            throws java.io.IOException
Read an int from the input stream

Returns:
an int
Throws:
java.io.IOException