org.codehaus.plexus.util
public class StringInputStream extends InputStream
Deprecated: As of version 1.5.2 this class should no longer be used because it does not properly handle character encoding. Instead, wrap the output from String#getBytes(String) into a java.io.ByteArrayInputStream.
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.Constructor Summary | |
---|---|
StringInputStream(String source)
Composes a stream from a String
|
Method Summary | |
---|---|
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.
|
Parameters: source The string to read from. Must not be null
.
Throws: IOException if the original StringReader fails to be closed
Parameters: limit the maximum limit of bytes that can be read before the mark position becomes invalid
See Also: InputStream#markSupported
Returns: the value of the next character in the StringReader
Throws: IOException if the original StringReader fails to be read
Throws: IOException if the StringReader fails to be reset