ist.palcom.storage.pio
Class StorageAccessStream

java.lang.Object
  extended by ist.palcom.storage.pio.StorageAccessStream

public class StorageAccessStream
extends java.lang.Object


Constructor Summary
StorageAccessStream(Storage store, java.lang.String fname)
          Create a StorageAccessStream
 
Method Summary
 int available()
          Check available space in a StorageAccessStream this is mostly applied for StorageAccessStream that access ByteStorage
 void close()
          Close a StorageAccessStream wrapp the StorageException to IOException
 long pos()
          Return the position of the pointer
 int read()
          Read from the StorageAccessStream
 int read(byte[] b, int off, int len)
          Read from the StorageAccessStream
 int readInt()
          Read from the StorageAccessStream
 void seek(int pos)
          Seek in a StorageAccessStream
 void write(byte[] b, int off, int len)
          Write a byte array
 void write(int b)
          Write a byte
 void writeInt(int v)
          Write an int
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StorageAccessStream

public StorageAccessStream(Storage store,
                           java.lang.String fname)
                    throws java.io.IOException
Create a StorageAccessStream

Parameters:
store - the Storage to use
fname - the filename for Storage to use
Throws:
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Close a StorageAccessStream wrapp the StorageException to IOException

Throws:
java.io.IOException

seek

public void seek(int pos)
          throws java.io.IOException
Seek in a StorageAccessStream

Parameters:
pos - the position to seek
Throws:
java.io.IOException

available

public int available()
              throws java.io.IOException
Check available space in a StorageAccessStream this is mostly applied for StorageAccessStream that access ByteStorage

Returns:
an int
Throws:
java.io.IOException

pos

public long pos()
         throws java.io.IOException
Return the position of the pointer

Returns:
an long
Throws:
java.io.IOException

read

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

Returns:
an int
Throws:
java.io.IOException

read

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

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 from the StorageAccessStream

Returns:
an Integer
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Write a byte

Parameters:
b - the Byte
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Write a byte array

Parameters:
b - the byte array
off - offset in the stream
len - lenght of the stream
Throws:
java.io.IOException

writeInt

public void writeInt(int v)
              throws java.io.IOException
Write an int

Parameters:
v - the int
Throws:
java.io.IOException