Class ASCII85OutputStream

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

    final class ASCII85OutputStream
    extends java.io.FilterOutputStream
    This class represents an ASCII85 output stream.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int count  
      private boolean flushed  
      private byte[] indata  
      private int lineBreak  
      private int maxline
      Function produces five ASCII printing characters from four bytes of binary data.
      private static char NEWLINE  
      private static char OFFSET  
      private byte[] outdata  
      private char terminator  
      private static char Z  
      • Fields inherited from class java.io.FilterOutputStream

        out
    • Constructor Summary

      Constructors 
      Constructor Description
      ASCII85OutputStream​(java.io.OutputStream out)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      This will close the stream.
      void flush()
      This will flush the data to the stream.
      int getLineLength()
      This will get the length of the line.
      char getTerminator()
      This will get the terminating character.
      void setLineLength​(int l)
      This will set the line length that will be used.
      void setTerminator​(char term)
      This will set the terminating character.
      private void transformASCII85()
      This will transform the next four ascii bytes.
      void write​(int b)
      This will write a single byte.
      • Methods inherited from class java.io.FilterOutputStream

        write, write
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

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

      • lineBreak

        private int lineBreak
      • count

        private int count
      • indata

        private byte[] indata
      • outdata

        private byte[] outdata
      • maxline

        private int maxline
        Function produces five ASCII printing characters from four bytes of binary data.
      • flushed

        private boolean flushed
      • terminator

        private char terminator
    • Constructor Detail

      • ASCII85OutputStream

        ASCII85OutputStream​(java.io.OutputStream out)
        Constructor.
        Parameters:
        out - The output stream to write to.
    • Method Detail

      • setTerminator

        public void setTerminator​(char term)
        This will set the terminating character.
        Parameters:
        term - The terminating character.
      • getTerminator

        public char getTerminator()
        This will get the terminating character.
        Returns:
        The terminating character.
      • setLineLength

        public void setLineLength​(int l)
        This will set the line length that will be used.
        Parameters:
        l - The length of the line to use.
      • getLineLength

        public int getLineLength()
        This will get the length of the line.
        Returns:
        The line length attribute.
      • transformASCII85

        private void transformASCII85()
        This will transform the next four ascii bytes.
      • write

        public void write​(int b)
                   throws java.io.IOException
        This will write a single byte.
        Overrides:
        write in class java.io.FilterOutputStream
        Parameters:
        b - The byte to write.
        Throws:
        java.io.IOException - If there is an error writing to the stream.
      • flush

        public void flush()
                   throws java.io.IOException
        This will flush the data to the stream.
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.FilterOutputStream
        Throws:
        java.io.IOException - If there is an error writing the data to the stream.
      • close

        public void close()
                   throws java.io.IOException
        This will close the stream.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.FilterOutputStream
        Throws:
        java.io.IOException - If there is an error closing the wrapped stream.