Package android.util

Class Base64OutputStream

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

    public class Base64OutputStream
    extends java.io.FilterOutputStream
    An OutputStream that does Base64 encoding on the data written to it, writing the resulting data to another OutputStream.
    • Field Summary

      • Fields inherited from class java.io.FilterOutputStream

        out
    • Constructor Summary

      Constructors 
      Constructor Description
      Base64OutputStream​(java.io.OutputStream out, int flags)
      Performs Base64 encoding on the data written to the stream, writing the encoded data to another OutputStream.
      Base64OutputStream​(java.io.OutputStream out, int flags, boolean encode)
      Performs Base64 encoding or decoding on the data written to the stream, writing the encoded/decoded data to another OutputStream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void write​(byte[] b, int off, int len)  
      void write​(int b)  
      • Methods inherited from class java.io.FilterOutputStream

        flush, 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
    • Constructor Detail

      • Base64OutputStream

        public Base64OutputStream​(java.io.OutputStream out,
                                  int flags)
        Performs Base64 encoding on the data written to the stream, writing the encoded data to another OutputStream.
        Parameters:
        out - the OutputStream to write the encoded data to
        flags - bit flags for controlling the encoder; see the constants in Base64
      • Base64OutputStream

        public Base64OutputStream​(java.io.OutputStream out,
                                  int flags,
                                  boolean encode)
        Performs Base64 encoding or decoding on the data written to the stream, writing the encoded/decoded data to another OutputStream.
        Parameters:
        out - the OutputStream to write the encoded data to
        flags - bit flags for controlling the encoder; see the constants in Base64
        encode - true to encode, false to decode
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
      • write

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

        public void close()
                   throws java.io.IOException
        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