File tree 2 files changed +8
-9
lines changed
jetty-client/src/main/java/org/eclipse/jetty/client
jetty-io/src/main/java/org/eclipse/jetty/io/content
2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 26
26
* <p>Content must be provided by writing to the {@link #getOutputStream() output stream}
27
27
* that must be {@link OutputStream#close() closed} when all content has been provided.</p>
28
28
* <p>Example usage:</p>
29
- * <pre>
29
+ * <pre>{@code
30
30
* HttpClient httpClient = ...;
31
31
*
32
32
* // Use try-with-resources to autoclose the output stream.
37
37
* .body(content)
38
38
* .send(new Response.CompleteListener()
39
39
* {
40
- * @ Override
40
+ * @ Override
41
41
* public void onComplete(Result result)
42
42
* {
43
43
* // Your logic here
50
50
* // Even later...
51
51
* output.write("more content".getBytes());
52
52
* } // Implicit call to output.close().
53
- * </pre>
53
+ * } </pre>
54
54
*/
55
55
public class OutputStreamRequestContent extends OutputStreamContentSource implements Request .Content
56
56
{
Original file line number Diff line number Diff line change 23
23
import org .eclipse .jetty .util .IO ;
24
24
25
25
/**
26
- * <p>
27
- * A {@link Content.Source} backed by an {@link OutputStream}.
28
- * Any bytes written to the {@link OutputStream} returned by {@link #getOutputStream()}
29
- * is converted to a {@link Content.Chunk} and returned from {@link #read()}. If
30
- * necessary, any {@link Runnable} passed to {@link #demand(Runnable)} is invoked.
31
- * </p>
26
+ * <p>A {@link Content.Source} that provides content asynchronously through an {@link OutputStream}.</p>
27
+ * <p>Bytes written to the {@link OutputStream} returned by {@link #getOutputStream()}
28
+ * are converted to a {@link Content.Chunk} and returned from {@link #read()}.</p>
29
+ * <p>The {@code OutputStream} must be closed to signal that all the content has been written.</p>
30
+ *
32
31
* @see AsyncContent
33
32
*/
34
33
public class OutputStreamContentSource implements Content .Source , Closeable
You can’t perform that action at this time.
0 commit comments