ByteArrayHttpMessageConverter class final
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
HttpMessageConvertersfor fallback binary handling.
- Inheritance
-
- Object
- HttpMessageConverter<
List< int> > - AbstractHttpMessageConverter<
List< int> > - ByteArrayHttpMessageConverter
Constructors
- ByteArrayHttpMessageConverter()
-
JetLeaf’s built-in AbstractHttpMessageConverter for handling
raw binary data with media type
application/octet-stream.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addDefaultHeaders(
HttpHeaders headers, MediaType? contentType) → void -
Adds default headers to the HTTP message if not already present.
inherited
-
addSupportedMediaType(
MediaType type) → void -
Adds a media type to the list of supported types.
inherited
-
canRead(
Class type, [MediaType? mediaType]) → bool -
Determines whether this converter can deserialize the given type from the specified media type.
inherited
-
canWrite(
Class type, [MediaType? mediaType]) → bool -
Determines whether this converter can serialize the given type to the specified media type.
inherited
-
equalizedProperties(
) → List< Object?> -
Mixin-style contract for value-based equality,
hashCode, andtoString. -
getClassSupportedMediaTypes(
Class< List< type) → List<int> >MediaType> -
Returns the media types specifically supported for a given class type.
inherited
-
getDefaultEncoding(
) → Encoding -
Returns the default character encoding used by this converter.
inherited
-
getSupportedMediaTypes(
) → List< MediaType> -
Returns the list of media types this converter supports by default.
inherited
-
matchesType(
Class type) → bool -
Returns whether the given
typematches this filter's criteria.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
Class< List< type, HttpInputMessage inputMessage) → Future<int> >List< int> > -
Deserializes an HTTP input message to a Dart object of type
T.inherited -
readInternal(
Class< List< type, HttpInputMessage inputMessage) → Future<int> >List< int> > -
Template method for reading and deserializing HTTP input.
override
-
removeSupportedMediaType(
MediaType type) → void -
Removes a media type from the list of supported types.
inherited
-
resolveRequestEncoding(
HttpInputMessage inputMessage) → Encoding -
Resolves the appropriate character encoding for reading the request body.
inherited
-
resolveResponseEncoding(
HttpOutputMessage outputMessage) → Encoding -
Resolves the appropriate character encoding for writing the response body.
inherited
-
setDefaultEncoding(
Encoding encoding) → void -
Sets the default character encoding for this converter.
inherited
-
setSupportedMediaTypes(
List< MediaType> types) → void -
Replaces the current supported media types with the provided list.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
List< int> object, MediaType? contentType, HttpOutputMessage outputMessage) → Future<void> -
Serializes a Dart object to an HTTP output message.
inherited
-
writeInternal(
List< int> object, HttpOutputMessage outputMessage) → Future<void> -
Template method for serializing an object to an HTTP output message.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited