to.etc.util
Class StringInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by to.etc.util.StringInputStream
All Implemented Interfaces:
java.io.Closeable

public class StringInputStream
extends java.io.InputStream

Returns a stream which is constructed from the specified string.

Author:
Frits Jalvingh Created on Jul 10, 2007

Constructor Summary
StringInputStream(java.lang.String s, java.lang.String enc)
           
 
Method Summary
 int available()
           
 void close()
           
 void mark(int readAheadLimit)
          Despite the Eclipse warning: do NOT add synchronized - it is wrong.
 boolean markSupported()
           
 int read()
           
 int read(byte[] arg0)
           
 int read(byte[] b, int off, int len)
           
 void reset()
          Despite the Eclipse warning: do NOT add synchronized - it is wrong.
 long skip(long n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringInputStream

public StringInputStream(java.lang.String s,
                         java.lang.String enc)
                  throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException
Method Detail

available

public int available()
Overrides:
available in class java.io.InputStream

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

mark

public void mark(int readAheadLimit)
Despite the Eclipse warning: do NOT add synchronized - it is wrong.

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

markSupported

public boolean markSupported()
Overrides:
markSupported in class java.io.InputStream

read

public int read()
Specified by:
read in class java.io.InputStream

read

public int read(byte[] b,
                int off,
                int len)
Overrides:
read in class java.io.InputStream

read

public int read(byte[] arg0)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

reset

public void reset()
Despite the Eclipse warning: do NOT add synchronized - it is wrong.

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

skip

public long skip(long n)
Overrides:
skip in class java.io.InputStream