Class StringInputStream

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

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

      Constructors 
      Constructor Description
      StringInputStream​(java.lang.String source)
      Composes a stream from a String
      StringInputStream​(java.lang.String source, java.lang.String encoding)
      Composes a stream from a String with the specified encoding
    • Method Summary

      • Methods inherited from class java.io.InputStream

        available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • 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)
        Composes a stream from a String
        Parameters:
        source - The string to read from. Must not be null.
      • StringInputStream

        public StringInputStream​(java.lang.String source,
                                 java.lang.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.