org.apache.synapse.securevault

## Class EncodingHelper

- java.lang.Object
- - org.apache.synapse.securevault.EncodingHelper

-     public final class EncodingHelper
      extends java.lang.Object

  Helper to handle encoding and decoding of data streams.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.io.InputStream` | `decode(java.io.InputStream inputStream, EncodingType encodingType)` Decodes the provided InputStream using the specified encoding type.
    `static byte[]` | `encode(java.io.ByteArrayOutputStream baos, EncodingType encodingType)` Encodes the provided ByteArrayOutputStream using the specified encoding type.

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

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

- - ### Method Detail

    - #### encode

          public static byte[] encode(java.io.ByteArrayOutputStream baos,
                                      EncodingType encodingType)

      Encodes the provided ByteArrayOutputStream using the specified encoding type.
      Parameters:
        `baos` - The ByteArrayOutputStream to encode
        `encodingType` - The encoding to use
      Returns:
        The encoded ByteArrayOutputStream as a String

    - #### decode

          public static java.io.InputStream decode(java.io.InputStream inputStream,
                                                   EncodingType encodingType)
                                            throws java.io.IOException

      Decodes the provided InputStream using the specified encoding type.
      Parameters:
        `inputStream` - The InputStream to decode
        `encodingType` - The encoding to use
      Returns:
        The decoded InputStream
      Throws:
        `java.io.IOException` - If an error occurs decoding the input stream
        `java.lang.IllegalArgumentException` - if the specified encodingType is not supported

Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.