Class LineReaderInputStreamAdaptor

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

    public class LineReaderInputStreamAdaptor
    extends LineReaderInputStream
    InputStream used by the MIME parser to detect whether the underlying data stream was used (read from) and whether the end of the stream was reached.
    • Field Detail

      • maxLineLen

        private final int maxLineLen
      • used

        private boolean used
      • eof

        private boolean eof
    • Constructor Detail

      • LineReaderInputStreamAdaptor

        public LineReaderInputStreamAdaptor​(java.io.InputStream is,
                                            int maxLineLen)
      • LineReaderInputStreamAdaptor

        public LineReaderInputStreamAdaptor​(java.io.InputStream is)
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • eof

        public boolean eof()
      • isUsed

        public boolean isUsed()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • unread

        public boolean unread​(ByteArrayBuffer buf)
        Description copied from class: LineReaderInputStream
        Tries to unread the last read line. Implementation may refuse to unread a new buffer until the previous unread one has been competely consumed. Implementations will directly use the byte array backed by buf, so make sure to not alter it anymore once this method has been called.
        Specified by:
        unread in class LineReaderInputStream
        Returns:
        true if the unread has been succesfull.
      • skip

        public long skip​(long count)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.FilterInputStream
        Throws:
        java.io.IOException