Class StringInputStream

All Implemented Interfaces:
Closeable, AutoCloseable

public class StringInputStream extends ReaderInputStream
Wraps a String as an InputStream.
  • Constructor Details

    • StringInputStream

      public StringInputStream(String source)
      Composes a stream from a String
      Parameters:
      source - The string to read from. Must not be null.
    • StringInputStream

      public StringInputStream(String source, String encoding)
      Composes a stream from a String with the specified encoding
      Parameters:
      source - The string to read from. Must not be null.
      encoding - The encoding scheme. Also must not be null.