org.sapia.ubik.util
Class ByteVectorInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.sapia.ubik.util.ByteVectorInputStream
All Implemented Interfaces:
java.io.Closeable

public class ByteVectorInputStream
extends java.io.InputStream

This class implements an InputStream over the ByteVector class.

The close() method has no effect on an instance of this class. The underlying ByteVector can be read from repetitively. If it must be re-read from the beginning, then the vector's reset() method must be called.

WARNING: THIS CLASS IS NOT THREAD-SAFE.

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2005 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site
See Also:
ByteVectorOutputStream

Constructor Summary
ByteVectorInputStream(ByteVector bytes)
           
 
Method Summary
 int available()
           
 void close()
           
 ByteVector getByteVector()
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteVectorInputStream

public ByteVectorInputStream(ByteVector bytes)
Method Detail

getByteVector

public ByteVector getByteVector()

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()

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,
                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)

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[])

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)


Copyright © 2010 Sapia OSS. All Rights Reserved.