Class InputStreamToByteArrayConverter
java.lang.Object
org.axonframework.serialization.converters.InputStreamToByteArrayConverter
- All Implemented Interfaces:
ContentTypeConverter<InputStream,byte[]>
public class InputStreamToByteArrayConverter
extends Object
implements ContentTypeConverter<InputStream,byte[]>
Converter that converts an InputStream to a byte array. This converter simply reads all contents from the
input stream and returns that as an array.
- Since:
- 2.0
- Author:
- Allard Buijze
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]convert(InputStream original) Converts the given object into another.The expected type of input data.Class<byte[]> The returned type of IntermediateRepresentation
-
Constructor Details
-
InputStreamToByteArrayConverter
public InputStreamToByteArrayConverter()
-
-
Method Details
-
expectedSourceType
Description copied from interface:ContentTypeConverterThe expected type of input data.- Specified by:
expectedSourceTypein interfaceContentTypeConverter<InputStream,byte[]> - Returns:
- the expected data format in IntermediateRepresentation
-
targetType
Description copied from interface:ContentTypeConverterThe returned type of IntermediateRepresentation- Specified by:
targetTypein interfaceContentTypeConverter<InputStream,byte[]> - Returns:
- the output data format in IntermediateRepresentation
-
convert
Description copied from interface:ContentTypeConverterConverts the given object into another. Typically, these values are contained by aSerializedObjectinstance.- Specified by:
convertin interfaceContentTypeConverter<InputStream,byte[]> - Parameters:
original- the value to convert- Returns:
- the converted value
-