Class EncodeDecodeHelper
- java.lang.Object
-
- org.apache.synapse.commons.crypto.EncodeDecodeHelper
-
public class EncodeDecodeHelper extends Object
This class is a helper class to do encoding and decoding
-
-
Constructor Summary
Constructors Constructor Description EncodeDecodeHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
decode(byte[] input, EncodeDecodeTypes decodingType)
Decodes the provided byte array using the specified decoding type.static byte[]
encode(byte[] input, EncodeDecodeTypes encodingType)
Encodes the provided byte array using the specified encoding type.
-
-
-
Method Detail
-
encode
public static byte[] encode(byte[] input, EncodeDecodeTypes encodingType)
Encodes the provided byte array using the specified encoding type.- Parameters:
input
- The byte array to encodeencodingType
- The encoding to use- Returns:
- The encoded ByteArrayOutputStream as a String
- Throws:
IllegalArgumentException
- if the specified decodingType is not supported
-
decode
public static byte[] decode(byte[] input, EncodeDecodeTypes decodingType)
Decodes the provided byte array using the specified decoding type.- Parameters:
input
- The byte array to decodedecodingType
- The decoding type to use- Returns:
- The decoded byte array
- Throws:
IllegalArgumentException
- if the specified decodingType is not supported
-
-