com.sun.mail.util

## Class UUEncoderStream

- java.lang.Object
- - java.io.OutputStream
  - - java.io.FilterOutputStream
    - - com.sun.mail.util.UUEncoderStream

- All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

      public class UUEncoderStream
      extends FilterOutputStream

  This class implements a UUEncoder. It is implemented as a FilterOutputStream, so one can just wrap this class around any output stream and write bytes into this filter. The Encoding is done as the bytes are written out.
  Author:
    John Mani

- - ### Field Summary

    - ### Fields inherited from class java.io.FilterOutputStream

      `out`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UUEncoderStream(OutputStream out)` Create a UUencoder that encodes the specified input stream
    `UUEncoderStream(OutputStream out, String name)` Create a UUencoder that encodes the specified input stream
    `UUEncoderStream(OutputStream out, String name, int mode)` Create a UUencoder that encodes the specified input stream

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `flush()`
    `void` | `setNameMode(String name, int mode)` Set up the buffer name and permission mode.
    `void` | `write(byte[] data)`
    `void` | `write(byte[] b, int off, int len)`
    `void` | `write(int c)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### UUEncoderStream

          public UUEncoderStream(OutputStream out)

      Create a UUencoder that encodes the specified input stream
      Parameters:
        `out` - the output stream

    - #### UUEncoderStream

          public UUEncoderStream(OutputStream out,
                         String name)

      Create a UUencoder that encodes the specified input stream
      Parameters:
        `out` - the output stream
        `name` - Specifies a name for the encoded buffer

    - #### UUEncoderStream

          public UUEncoderStream(OutputStream out,
                         String name,
                         int mode)

      Create a UUencoder that encodes the specified input stream
      Parameters:
        `out` - the output stream
        `name` - Specifies a name for the encoded buffer
        `mode` - Specifies permission mode for the encoded buffer

  - ### Method Detail

    - #### setNameMode

          public void setNameMode(String name,
                         int mode)

      Set up the buffer name and permission mode. This method has any effect only if it is invoked before you start writing into the output stream
      Parameters:
        `name` - the buffer name
        `mode` - the permission mode

    - #### write

          public void write(byte[] b,
                   int off,
                   int len)
                     throws IOException

      Overrides:
        `write` in class `FilterOutputStream`
      Throws:
        `IOException`

    - #### write

          public void write(byte[] data)
                     throws IOException

      Overrides:
        `write` in class `FilterOutputStream`
      Throws:
        `IOException`

    - #### write

          public void write(int c)
                     throws IOException

      Overrides:
        `write` in class `FilterOutputStream`
      Throws:
        `IOException`

    - #### flush

          public void flush()
                     throws IOException

      Specified by:
        `flush` in interface `Flushable`
      Overrides:
        `flush` in class `FilterOutputStream`
      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Overrides:
        `close` in class `FilterOutputStream`
      Throws:
        `IOException`

Copyright © 2016 Oracle. All rights reserved.