Module jakarta.mail

Class AsciiOutputStream

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

    class AsciiOutputStream
    extends java.io.OutputStream
    An OutputStream that determines whether the data written to it is all ASCII, mostly ASCII, or mostly non-ASCII.
    • Constructor Summary

      Constructors 
      Constructor Description
      AsciiOutputStream​(boolean breakOnNonAscii, boolean encodeEolStrict)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void check​(int b)  
      int getAscii()
      Return ASCII-ness of data stream.
      void write​(byte[] b)  
      void write​(byte[] b, int off, int len)  
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

        close, flush, nullOutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • breakOnNonAscii

        private boolean breakOnNonAscii
      • ascii

        private int ascii
      • non_ascii

        private int non_ascii
      • linelen

        private int linelen
      • longLine

        private boolean longLine
      • badEOL

        private boolean badEOL
      • checkEOL

        private boolean checkEOL
      • lastb

        private int lastb
      • ret

        private int ret
    • Constructor Detail

      • AsciiOutputStream

        public AsciiOutputStream​(boolean breakOnNonAscii,
                                 boolean encodeEolStrict)
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] b)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • check

        private final void check​(int b)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getAscii

        public int getAscii()
        Return ASCII-ness of data stream.