code: @Override
    public void write (final int theByte) throws IOException
    {
      // Encoding suspended?
      if (m_bSuspendEncoding)
      {
        out.write (theByte);
        return;
      }
  
      // Encode?
      if (m_bEncode)
      {
        m_aBuffer[m_nPosition++] = (byte) theByte;
        if (m_nPosition >= m_nBufferLength)
        { // Enough to encode.
  
          out.write (Base64._encode3to4 (m_aB4, m_aBuffer, m_nBufferLength, m_nOptions));
  
          m_nLineLength += 4;
          if (m_bBreakLines && m_nLineLength >= Base64.MAX_LINE_LENGTH)
          {
            out.write (Base64.NEW_LINE);
            m_nLineLength = 0;
          }
          m_nPosition = 0;
        }
      }
      // Else, Decoding
      else
      {
        // Meaningful Base64 character?
        if (m_aDecodabet[theByte & 0x7f] > Base64.WHITE_SPACE_ENC)
        {
          m_aBuffer[m_nPosition++] = (byte) theByte;
          if (m_nPosition >= m_nBufferLength)
          { // Enough to output.
  
            final int len = Base64._decode4to3 (m_aBuffer, 0, m_aB4, 0, m_nOptions);
            out.write (m_aB4, 0, len);
            m_nPosition = 0;
          }
        }
        else
          if (m_aDecodabet[theByte & 0x7f] != Base64.WHITE_SPACE_ENC)
          {
            throw new IOException ("Invalid character in Base64 data.");
          }
      }
    }
docs: Writes the byte to the output stream after converting to/from Base64
  notation. When encoding, bytes are buffered three at a time before the
  output stream actually gets a write() call. When decoding, bytes are
  buffered four at a time.
  
  @param theByte
  the byte to write
  @since 1.3