Package org.apache.synapse.securevault
Class EncodingHelper
java.lang.Object
org.apache.synapse.securevault.EncodingHelper
Helper to handle encoding and decoding of data streams.
-
Method Summary
Modifier and TypeMethodDescriptionstatic InputStreamdecode(InputStream inputStream, EncodingType encodingType) Decodes the provided InputStream using the specified encoding type.static byte[]encode(ByteArrayOutputStream baos, EncodingType encodingType) Encodes the provided ByteArrayOutputStream using the specified encoding type.
-
Method Details
-
encode
Encodes the provided ByteArrayOutputStream using the specified encoding type.- Parameters:
baos- The ByteArrayOutputStream to encodeencodingType- The encoding to use- Returns:
- The encoded ByteArrayOutputStream as a String
-
decode
public static InputStream decode(InputStream inputStream, EncodingType encodingType) throws IOException Decodes the provided InputStream using the specified encoding type.- Parameters:
inputStream- The InputStream to decodeencodingType- The encoding to use- Returns:
- The decoded InputStream
- Throws:
IOException- If an error occurs decoding the input streamIllegalArgumentException- if the specified encodingType is not supported
-