org.codehaus.plexus.util

## Class StringInputStream

- java.lang.Object
- - java.io.InputStream
  - - org.codehaus.plexus.util.StringInputStream

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

  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 `ByteArrayInputStream`.

      public class StringInputStream
      extends java.io.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.
  Author:
    Magesh Umasankar

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringInputStream(java.lang.String source)` Deprecated. Composes a stream from a String

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Deprecated. Closes the Stringreader.
    `void` | `mark(int limit)` Deprecated. Marks the read limit of the StringReader.
    `boolean` | `markSupported()` Deprecated.
    `int` | `read()` Deprecated. Reads from the Stringreader, returning the same value.
    `void` | `reset()` Deprecated. Resets the StringReader.

    - ### Methods inherited from class java.io.InputStream

      `available, read, read, skip`

    - ### 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 source)

      Deprecated.
      Composes a stream from a String
      Parameters:
        `source` - The string to read from. Must not be `null`.

  - ### Method Detail

    - #### read

          public int read()
                   throws java.io.IOException

      Deprecated.
      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:
        `read` in class `java.io.InputStream`
      Returns:
        the value of the next character in the StringReader
      Throws:
        `java.io.IOException` - if the original StringReader fails to be read

    - #### close

          public void close()
                     throws java.io.IOException

      Deprecated.
      Closes the Stringreader.
      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Overrides:
        `close` in class `java.io.InputStream`
      Throws:
        `java.io.IOException` - if the original StringReader fails to be closed

    - #### mark

          public void mark(int limit)

      Deprecated.
      Marks the read limit of the StringReader.
      Overrides:
        `mark` in class `java.io.InputStream`
      Parameters:
        `limit` - the maximum limit of bytes that can be read before the mark position becomes invalid

    - #### reset

          public void reset()
                     throws java.io.IOException

      Deprecated.
      Resets the StringReader.
      Overrides:
        `reset` in class `java.io.InputStream`
      Throws:
        `java.io.IOException` - if the StringReader fails to be reset

    - #### markSupported

          public boolean markSupported()

      Deprecated.
      Overrides:
        `markSupported` in class `java.io.InputStream`
      See Also:
        `InputStream.markSupported()`