Restore use of Flux-based encode method in HTTP

Closes gh-24441
This commit is contained in:
Rossen Stoyanchev
2020-02-07 21:44:44 +00:00
parent a03a116f6b
commit df706f4c7c
5 changed files with 45 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -78,9 +78,9 @@ public interface Decoder<T> {
@Nullable MimeType mimeType, @Nullable Map<String, Object> hints);
/**
* Decode a data buffer to an Object of type T. This is useful when the input
* stream consists of discrete messages (or events) and the content for each
* can be decoded on its own.
* Decode a data buffer to an Object of type T. This is useful for scenarios,
* that distinct messages (or events) are decoded and handled individually,
* in fully aggregated form.
* @param buffer the {@code DataBuffer} to decode
* @param targetType the expected output type
* @param mimeType the MIME type associated with the data

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,9 +68,9 @@ public interface Encoder<T> {
ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints);
/**
* Encode an Object of type T to a data buffer. This is useful for scenarios
* that produce a stream of discrete messages (or events) and the
* content for each is encoded individually.
* Encode an Object of type T to a data buffer. This is useful for scenarios,
* that distinct messages (or events) are encoded and handled individually,
* in fully aggregated form.
* <p>By default this method raises {@link UnsupportedOperationException}
* and it is expected that some encoders cannot produce a single buffer or
* cannot do so synchronously (e.g. encoding a {@code Resource}).