org.codehaus.plexus.util
Class StringInputStream
InputStream
org.codehaus.plexus.util.StringInputStream
public class StringInputStream
extends InputStream
Wraps a String as an InputStream. Note that data will be lost for
characters not in ISO Latin 1, as a simple char->byte mapping is assumed.
void | close() - Closes the Stringreader.
|
void | mark(int limit) - Marks the read limit of the StringReader.
|
boolean | markSupported()
|
int | read() - Reads from the Stringreader, returning the same value.
|
void | reset() - Resets the StringReader.
|
StringInputStream
public StringInputStream(String source)
Composes a stream from a String
source
- The string to read from. Must not be null
.
close
public void close()
throws IOException
Closes the Stringreader.
mark
public void mark(int limit)
Marks the read limit of the StringReader.
limit
- the maximum limit of bytes that can be read before the
mark position becomes invalid
markSupported
public boolean markSupported()
InputStream.markSupported
read
public int read()
throws IOException
Reads from the Stringreader, returning the same value. Note that
data will be lost for characters not in ISO Latin 1. Clients
assuming a return value in the range -1 to 255 may even fail on
such input.
- the value of the next character in the StringReader
reset
public void reset()
throws IOException
Resets the StringReader.