Package org.codehaus.plexus.util
Class StringInputStream
java.lang.Object
java.io.InputStream
org.codehaus.plexus.util.StringInputStream
- All Implemented Interfaces:
- Closeable,- AutoCloseable
Deprecated.
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.
- Author:
- Magesh Umasankar
- 
Constructor SummaryConstructorsConstructorDescriptionStringInputStream(String source) Deprecated.Composes a stream from a String
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Deprecated.Closes the Stringreader.voidmark(int limit) Deprecated.Marks the read limit of the StringReader.booleanDeprecated.intread()Deprecated.Reads from the Stringreader, returning the same value.voidreset()Deprecated.Resets the StringReader.Methods inherited from class java.io.InputStreamavailable, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo
- 
Constructor Details- 
StringInputStreamDeprecated.Composes a stream from a String- Parameters:
- source- The string to read from. Must not be- null.
 
 
- 
- 
Method Details- 
readDeprecated.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.- Specified by:
- readin class- InputStream
- Returns:
- the value of the next character in the StringReader
- Throws:
- IOException- if the original StringReader fails to be read
 
- 
closeDeprecated.Closes the Stringreader.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- InputStream
- Throws:
- IOException- if the original StringReader fails to be closed
 
- 
markpublic void mark(int limit) Deprecated.Marks the read limit of the StringReader.- Overrides:
- markin class- InputStream
- Parameters:
- limit- the maximum limit of bytes that can be read before the mark position becomes invalid
 
- 
resetDeprecated.Resets the StringReader.- Overrides:
- resetin class- InputStream
- Throws:
- IOException- if the StringReader fails to be reset
 
- 
markSupportedpublic boolean markSupported()Deprecated.- Overrides:
- markSupportedin class- InputStream
- See Also:
 
 
- 
String.getBytes(String)into aByteArrayInputStream.