ByteArrayHttpMessageConverter constructor

ByteArrayHttpMessageConverter()

JetLeaf’s built-in AbstractHttpMessageConverter for handling raw binary data with media type application/octet-stream.

This converter supports:

  • Inbound conversion: Reads the full request body as a List<int>.
  • Outbound conversion: Writes a binary List<int> directly to the response stream.

Supported Media Types

  • application/octet-stream

Example

final converter = ByteArrayHttpMessageConverter();
final bytes = await converter.read(List<int>, request);
await converter.write(bytes, response);

Design Notes

  • Used by JetLeaf for binary payloads such as file uploads/downloads.
  • Optimized for direct byte stream transfer without text decoding.
  • Registered internally by HttpMessageConverters for fallback binary handling.

Implementation

ByteArrayHttpMessageConverter() : super() {
  super.addSupportedMediaType(MediaType.APPLICATION_OCTET_STREAM);
}