Interface BinaryStringEncoder


  • @Role
    public interface BinaryStringEncoder
    Encoder to encode binary data to string data.
    Since:
    5.4M1
    Version:
    $Id: 1d6fd3586b24ac7b5b477cecbb94c9c8eb6969e6 $
    • Method Detail

      • getDecoderInputStream

        FilterInputStream getDecoderInputStream​(InputStream is)
        Return a decoding input stream based on this encoder.
        Parameters:
        is - an input stream to filter.
        Returns:
        a filtered input stream based on this encoder.
      • getEncoderOutputStream

        FilterOutputStream getEncoderOutputStream​(OutputStream os)
        Return a encoding output stream based on this encoder.
        Parameters:
        os - an output stream to filter.
        Returns:
        a filtered output stream based on this encoder.
      • getEncoderOutputStream

        FilterOutputStream getEncoderOutputStream​(OutputStream os,
                                                  int wrapAt)
        Return a encoding output stream based on this encoder, wrapping lines at a fixed length.
        Parameters:
        os - an output stream to filter.
        wrapAt - maximum length of a line.
        Returns:
        a filtered output stream based on this encoder.
      • encode

        String encode​(byte[] input)
               throws IOException
        Encode input with this encoder and without any wrapping.
        Parameters:
        input - a byte array.
        Returns:
        a string representing the encoded byte array.
        Throws:
        IOException - on error.
      • encode

        String encode​(byte[] input,
                      int wrapAt)
               throws IOException
        Encode input with this encoder, wrapping line at a fixed length.
        Parameters:
        input - a byte array.
        wrapAt - maximum length of a line.
        Returns:
        a string representing the encoded byte array.
        Throws:
        IOException - on error.
      • encode

        String encode​(byte[] input,
                      int off,
                      int len)
               throws IOException
        Encode input with this encoder and without any wrapping.
        Parameters:
        input - a byte array.
        off - offset to start with in the byte array.
        len - to encode in the byte array.
        Returns:
        a string representing the encoded byte array.
        Throws:
        IOException - on error.
      • encode

        String encode​(byte[] input,
                      int off,
                      int len,
                      int wrapAt)
               throws IOException
        Encode input with this encoder, wrapping line at a fixed length.
        Parameters:
        input - a byte array.
        off - offset to start with in the byte array.
        len - to encode in the byte array.
        wrapAt - maximum length of a line.
        Returns:
        a string representing the encoded byte array.
        Throws:
        IOException - on error.
      • decode

        byte[] decode​(String input)
               throws IOException
        Decode input string to bytes, whitespace and line-feed are ignored.
        Parameters:
        input - a string to decode.
        Returns:
        a bytes array.
        Throws:
        IOException - on error.