Class StringInputStream

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

    public class StringInputStream
    extends java.io.ByteArrayInputStream
    Creates an input stream from a string.
    Author:
    Yossi Shaul
    • Field Summary

      • Fields inherited from class java.io.ByteArrayInputStream

        buf, count, mark, pos
    • Constructor Summary

      Constructors 
      Constructor Description
      StringInputStream​(java.lang.String string)  
      StringInputStream​(java.lang.String string, java.lang.String encoding)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getLength()  
      • Methods inherited from class java.io.ByteArrayInputStream

        available, close, mark, markSupported, read, read, readAllBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.io.InputStream

        nullInputStream, read, readNBytes
      • 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 string)
                          throws java.io.UnsupportedEncodingException
        Throws:
        java.io.UnsupportedEncodingException
      • StringInputStream

        public StringInputStream​(java.lang.String string,
                                 java.lang.String encoding)
                          throws java.io.UnsupportedEncodingException
        Throws:
        java.io.UnsupportedEncodingException
    • Method Detail

      • getLength

        public int getLength()
        Returns:
        The length, in bytes, of the input stream