author | mbaesken |
Thu, 28 Nov 2019 13:02:39 +0100 | |
changeset 59323 | ae2eb76c486d |
parent 55520 | 33bb8c970770 |
child 58679 | 9c3209ff7550 |
permissions | -rw-r--r-- |
48083 | 1 |
/* |
55426
4efe251009b4
8226303: Examine the HttpRequest.BodyPublishers for exception handling
prappo
parents:
49765
diff
changeset
|
2 |
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. |
48083 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
49765 | 26 |
package jdk.internal.net.http; |
48083 | 27 |
|
28 |
import java.io.File; |
|
29 |
import java.io.FileInputStream; |
|
49765 | 30 |
import java.io.FileNotFoundException; |
31 |
import java.io.FilePermission; |
|
48083 | 32 |
import java.io.IOException; |
33 |
import java.io.InputStream; |
|
34 |
import java.io.UncheckedIOException; |
|
35 |
import java.nio.ByteBuffer; |
|
36 |
import java.nio.charset.Charset; |
|
49765 | 37 |
import java.nio.file.Files; |
48083 | 38 |
import java.nio.file.Path; |
39 |
import java.security.AccessControlContext; |
|
40 |
import java.security.AccessController; |
|
41 |
import java.security.PrivilegedAction; |
|
42 |
import java.security.PrivilegedActionException; |
|
43 |
import java.security.PrivilegedExceptionAction; |
|
44 |
import java.util.ArrayList; |
|
45 |
import java.util.Collections; |
|
46 |
import java.util.Iterator; |
|
47 |
import java.util.List; |
|
48 |
import java.util.NoSuchElementException; |
|
48379
5382baab8371
8193698: Null handling in BodyPublisher, BodyHandler, and BodySubscriber convenience static factory methods
chegar
parents:
48083
diff
changeset
|
49 |
import java.util.Objects; |
48083 | 50 |
import java.util.concurrent.ConcurrentLinkedQueue; |
51 |
import java.util.concurrent.Flow; |
|
48408
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
52 |
import java.util.concurrent.Flow.Publisher; |
48083 | 53 |
import java.util.function.Supplier; |
49765 | 54 |
import java.net.http.HttpRequest.BodyPublisher; |
55 |
import jdk.internal.net.http.common.Utils; |
|
48083 | 56 |
|
49765 | 57 |
public final class RequestPublishers { |
48083 | 58 |
|
49765 | 59 |
private RequestPublishers() { } |
60 |
||
61 |
public static class ByteArrayPublisher implements BodyPublisher { |
|
48083 | 62 |
private final int length; |
63 |
private final byte[] content; |
|
64 |
private final int offset; |
|
65 |
private final int bufSize; |
|
66 |
||
49765 | 67 |
public ByteArrayPublisher(byte[] content) { |
48083 | 68 |
this(content, 0, content.length); |
69 |
} |
|
70 |
||
49765 | 71 |
public ByteArrayPublisher(byte[] content, int offset, int length) { |
48083 | 72 |
this(content, offset, length, Utils.BUFSIZE); |
73 |
} |
|
74 |
||
75 |
/* bufSize exposed for testing purposes */ |
|
76 |
ByteArrayPublisher(byte[] content, int offset, int length, int bufSize) { |
|
77 |
this.content = content; |
|
78 |
this.offset = offset; |
|
79 |
this.length = length; |
|
80 |
this.bufSize = bufSize; |
|
81 |
} |
|
82 |
||
83 |
List<ByteBuffer> copy(byte[] content, int offset, int length) { |
|
84 |
List<ByteBuffer> bufs = new ArrayList<>(); |
|
85 |
while (length > 0) { |
|
86 |
ByteBuffer b = ByteBuffer.allocate(Math.min(bufSize, length)); |
|
87 |
int max = b.capacity(); |
|
88 |
int tocopy = Math.min(max, length); |
|
89 |
b.put(content, offset, tocopy); |
|
90 |
offset += tocopy; |
|
91 |
length -= tocopy; |
|
92 |
b.flip(); |
|
93 |
bufs.add(b); |
|
94 |
} |
|
95 |
return bufs; |
|
96 |
} |
|
97 |
||
98 |
@Override |
|
99 |
public void subscribe(Flow.Subscriber<? super ByteBuffer> subscriber) { |
|
100 |
List<ByteBuffer> copy = copy(content, offset, length); |
|
55520
33bb8c970770
8222968: ByteArrayPublisher is not thread-safe resulting in broken re-use of HttpRequests
michaelm
parents:
55426
diff
changeset
|
101 |
var delegate = new PullPublisher<>(copy); |
48083 | 102 |
delegate.subscribe(subscriber); |
103 |
} |
|
104 |
||
105 |
@Override |
|
106 |
public long contentLength() { |
|
107 |
return length; |
|
108 |
} |
|
109 |
} |
|
110 |
||
111 |
// This implementation has lots of room for improvement. |
|
49765 | 112 |
public static class IterablePublisher implements BodyPublisher { |
48083 | 113 |
private final Iterable<byte[]> content; |
114 |
private volatile long contentLength; |
|
115 |
||
49765 | 116 |
public IterablePublisher(Iterable<byte[]> content) { |
48379
5382baab8371
8193698: Null handling in BodyPublisher, BodyHandler, and BodySubscriber convenience static factory methods
chegar
parents:
48083
diff
changeset
|
117 |
this.content = Objects.requireNonNull(content); |
48083 | 118 |
} |
119 |
||
120 |
// The ByteBufferIterator will iterate over the byte[] arrays in |
|
121 |
// the content one at the time. |
|
122 |
// |
|
123 |
class ByteBufferIterator implements Iterator<ByteBuffer> { |
|
124 |
final ConcurrentLinkedQueue<ByteBuffer> buffers = new ConcurrentLinkedQueue<>(); |
|
125 |
final Iterator<byte[]> iterator = content.iterator(); |
|
126 |
@Override |
|
127 |
public boolean hasNext() { |
|
128 |
return !buffers.isEmpty() || iterator.hasNext(); |
|
129 |
} |
|
130 |
||
131 |
@Override |
|
132 |
public ByteBuffer next() { |
|
133 |
ByteBuffer buffer = buffers.poll(); |
|
134 |
while (buffer == null) { |
|
135 |
copy(); |
|
136 |
buffer = buffers.poll(); |
|
137 |
} |
|
138 |
return buffer; |
|
139 |
} |
|
140 |
||
141 |
ByteBuffer getBuffer() { |
|
142 |
return Utils.getBuffer(); |
|
143 |
} |
|
144 |
||
145 |
void copy() { |
|
146 |
byte[] bytes = iterator.next(); |
|
147 |
int length = bytes.length; |
|
148 |
if (length == 0 && iterator.hasNext()) { |
|
149 |
// avoid inserting empty buffers, except |
|
150 |
// if that's the last. |
|
151 |
return; |
|
152 |
} |
|
153 |
int offset = 0; |
|
154 |
do { |
|
155 |
ByteBuffer b = getBuffer(); |
|
156 |
int max = b.capacity(); |
|
157 |
||
158 |
int tocopy = Math.min(max, length); |
|
159 |
b.put(bytes, offset, tocopy); |
|
160 |
offset += tocopy; |
|
161 |
length -= tocopy; |
|
162 |
b.flip(); |
|
163 |
buffers.add(b); |
|
164 |
} while (length > 0); |
|
165 |
} |
|
166 |
} |
|
167 |
||
168 |
public Iterator<ByteBuffer> iterator() { |
|
169 |
return new ByteBufferIterator(); |
|
170 |
} |
|
171 |
||
172 |
@Override |
|
173 |
public void subscribe(Flow.Subscriber<? super ByteBuffer> subscriber) { |
|
174 |
Iterable<ByteBuffer> iterable = this::iterator; |
|
55520
33bb8c970770
8222968: ByteArrayPublisher is not thread-safe resulting in broken re-use of HttpRequests
michaelm
parents:
55426
diff
changeset
|
175 |
var delegate = new PullPublisher<>(iterable); |
48083 | 176 |
delegate.subscribe(subscriber); |
177 |
} |
|
178 |
||
179 |
static long computeLength(Iterable<byte[]> bytes) { |
|
180 |
long len = 0; |
|
181 |
for (byte[] b : bytes) { |
|
182 |
len = Math.addExact(len, (long)b.length); |
|
183 |
} |
|
184 |
return len; |
|
185 |
} |
|
186 |
||
187 |
@Override |
|
188 |
public long contentLength() { |
|
189 |
if (contentLength == 0) { |
|
190 |
synchronized(this) { |
|
191 |
if (contentLength == 0) { |
|
192 |
contentLength = computeLength(content); |
|
193 |
} |
|
194 |
} |
|
195 |
} |
|
196 |
return contentLength; |
|
197 |
} |
|
198 |
} |
|
199 |
||
49765 | 200 |
public static class StringPublisher extends ByteArrayPublisher { |
48083 | 201 |
public StringPublisher(String content, Charset charset) { |
202 |
super(content.getBytes(charset)); |
|
203 |
} |
|
204 |
} |
|
205 |
||
49765 | 206 |
public static class EmptyPublisher implements BodyPublisher { |
48083 | 207 |
private final Flow.Publisher<ByteBuffer> delegate = |
208 |
new PullPublisher<ByteBuffer>(Collections.emptyList(), null); |
|
209 |
||
210 |
@Override |
|
211 |
public long contentLength() { |
|
212 |
return 0; |
|
213 |
} |
|
214 |
||
215 |
@Override |
|
216 |
public void subscribe(Flow.Subscriber<? super ByteBuffer> subscriber) { |
|
217 |
delegate.subscribe(subscriber); |
|
218 |
} |
|
219 |
} |
|
220 |
||
49765 | 221 |
/** |
222 |
* Publishes the content of a given file. |
|
223 |
* |
|
224 |
* Privileged actions are performed within a limited doPrivileged that only |
|
225 |
* asserts the specific, read, file permission that was checked during the |
|
226 |
* construction of this FilePublisher. |
|
227 |
*/ |
|
228 |
public static class FilePublisher implements BodyPublisher { |
|
229 |
||
230 |
private static final FilePermission[] EMPTY_FILE_PERMISSIONS = new FilePermission[0]; |
|
231 |
||
48083 | 232 |
private final File file; |
49765 | 233 |
private final FilePermission[] filePermissions; |
48083 | 234 |
|
49765 | 235 |
private static String pathForSecurityCheck(Path path) { |
236 |
return path.toFile().getPath(); |
|
48083 | 237 |
} |
238 |
||
49765 | 239 |
/** |
240 |
* Factory for creating FilePublisher. |
|
241 |
* |
|
242 |
* Permission checks are performed here before construction of the |
|
243 |
* FilePublisher. Permission checking and construction are deliberately |
|
244 |
* and tightly co-located. |
|
245 |
*/ |
|
246 |
public static FilePublisher create(Path path) throws FileNotFoundException { |
|
247 |
FilePermission filePermission = null; |
|
248 |
SecurityManager sm = System.getSecurityManager(); |
|
249 |
if (sm != null) { |
|
250 |
String fn = pathForSecurityCheck(path); |
|
251 |
FilePermission readPermission = new FilePermission(fn, "read"); |
|
252 |
sm.checkPermission(readPermission); |
|
253 |
filePermission = readPermission; |
|
254 |
} |
|
255 |
||
256 |
// existence check must be after permission checks |
|
257 |
if (Files.notExists(path)) |
|
258 |
throw new FileNotFoundException(path + " not found"); |
|
259 |
||
260 |
return new FilePublisher(path, filePermission); |
|
261 |
} |
|
262 |
||
263 |
private FilePublisher(Path name, FilePermission filePermission) { |
|
264 |
assert filePermission != null ? filePermission.getActions().equals("read") : true; |
|
265 |
file = name.toFile(); |
|
266 |
this.filePermissions = filePermission == null ? EMPTY_FILE_PERMISSIONS |
|
267 |
: new FilePermission[] { filePermission }; |
|
48083 | 268 |
} |
269 |
||
270 |
@Override |
|
271 |
public void subscribe(Flow.Subscriber<? super ByteBuffer> subscriber) { |
|
55426
4efe251009b4
8226303: Examine the HttpRequest.BodyPublishers for exception handling
prappo
parents:
49765
diff
changeset
|
272 |
InputStream is = null; |
4efe251009b4
8226303: Examine the HttpRequest.BodyPublishers for exception handling
prappo
parents:
49765
diff
changeset
|
273 |
Throwable t = null; |
49765 | 274 |
if (System.getSecurityManager() == null) { |
275 |
try { |
|
276 |
is = new FileInputStream(file); |
|
277 |
} catch (IOException ioe) { |
|
55426
4efe251009b4
8226303: Examine the HttpRequest.BodyPublishers for exception handling
prappo
parents:
49765
diff
changeset
|
278 |
t = ioe; |
49765 | 279 |
} |
280 |
} else { |
|
281 |
try { |
|
282 |
PrivilegedExceptionAction<FileInputStream> pa = |
|
283 |
() -> new FileInputStream(file); |
|
284 |
is = AccessController.doPrivileged(pa, null, filePermissions); |
|
285 |
} catch (PrivilegedActionException pae) { |
|
55426
4efe251009b4
8226303: Examine the HttpRequest.BodyPublishers for exception handling
prappo
parents:
49765
diff
changeset
|
286 |
t = pae.getCause(); |
49765 | 287 |
} |
48083 | 288 |
} |
55426
4efe251009b4
8226303: Examine the HttpRequest.BodyPublishers for exception handling
prappo
parents:
49765
diff
changeset
|
289 |
final InputStream fis = is; |
4efe251009b4
8226303: Examine the HttpRequest.BodyPublishers for exception handling
prappo
parents:
49765
diff
changeset
|
290 |
PullPublisher<ByteBuffer> publisher; |
4efe251009b4
8226303: Examine the HttpRequest.BodyPublishers for exception handling
prappo
parents:
49765
diff
changeset
|
291 |
if (t == null) { |
4efe251009b4
8226303: Examine the HttpRequest.BodyPublishers for exception handling
prappo
parents:
49765
diff
changeset
|
292 |
publisher = new PullPublisher<>(() -> new StreamIterator(fis)); |
4efe251009b4
8226303: Examine the HttpRequest.BodyPublishers for exception handling
prappo
parents:
49765
diff
changeset
|
293 |
} else { |
4efe251009b4
8226303: Examine the HttpRequest.BodyPublishers for exception handling
prappo
parents:
49765
diff
changeset
|
294 |
publisher = new PullPublisher<>(null, t); |
4efe251009b4
8226303: Examine the HttpRequest.BodyPublishers for exception handling
prappo
parents:
49765
diff
changeset
|
295 |
} |
48083 | 296 |
publisher.subscribe(subscriber); |
297 |
} |
|
298 |
||
299 |
@Override |
|
300 |
public long contentLength() { |
|
49765 | 301 |
if (System.getSecurityManager() == null) { |
302 |
return file.length(); |
|
303 |
} else { |
|
304 |
PrivilegedAction<Long> pa = () -> file.length(); |
|
305 |
return AccessController.doPrivileged(pa, null, filePermissions); |
|
306 |
} |
|
48083 | 307 |
} |
308 |
} |
|
309 |
||
310 |
/** |
|
311 |
* Reads one buffer ahead all the time, blocking in hasNext() |
|
312 |
*/ |
|
49765 | 313 |
public static class StreamIterator implements Iterator<ByteBuffer> { |
48083 | 314 |
final InputStream is; |
315 |
final Supplier<? extends ByteBuffer> bufSupplier; |
|
316 |
volatile ByteBuffer nextBuffer; |
|
317 |
volatile boolean need2Read = true; |
|
318 |
volatile boolean haveNext; |
|
319 |
||
320 |
StreamIterator(InputStream is) { |
|
321 |
this(is, Utils::getBuffer); |
|
322 |
} |
|
323 |
||
324 |
StreamIterator(InputStream is, Supplier<? extends ByteBuffer> bufSupplier) { |
|
325 |
this.is = is; |
|
326 |
this.bufSupplier = bufSupplier; |
|
327 |
} |
|
328 |
||
329 |
// Throwable error() { |
|
330 |
// return error; |
|
331 |
// } |
|
332 |
||
333 |
private int read() { |
|
334 |
nextBuffer = bufSupplier.get(); |
|
335 |
nextBuffer.clear(); |
|
336 |
byte[] buf = nextBuffer.array(); |
|
337 |
int offset = nextBuffer.arrayOffset(); |
|
338 |
int cap = nextBuffer.capacity(); |
|
339 |
try { |
|
340 |
int n = is.read(buf, offset, cap); |
|
341 |
if (n == -1) { |
|
342 |
is.close(); |
|
343 |
return -1; |
|
344 |
} |
|
345 |
//flip |
|
346 |
nextBuffer.limit(n); |
|
347 |
nextBuffer.position(0); |
|
348 |
return n; |
|
349 |
} catch (IOException ex) { |
|
350 |
return -1; |
|
351 |
} |
|
352 |
} |
|
353 |
||
354 |
@Override |
|
355 |
public synchronized boolean hasNext() { |
|
356 |
if (need2Read) { |
|
357 |
haveNext = read() != -1; |
|
358 |
if (haveNext) { |
|
359 |
need2Read = false; |
|
360 |
} |
|
361 |
return haveNext; |
|
362 |
} |
|
363 |
return haveNext; |
|
364 |
} |
|
365 |
||
366 |
@Override |
|
367 |
public synchronized ByteBuffer next() { |
|
368 |
if (!hasNext()) { |
|
369 |
throw new NoSuchElementException(); |
|
370 |
} |
|
371 |
need2Read = true; |
|
372 |
return nextBuffer; |
|
373 |
} |
|
374 |
||
375 |
} |
|
376 |
||
49765 | 377 |
public static class InputStreamPublisher implements BodyPublisher { |
48083 | 378 |
private final Supplier<? extends InputStream> streamSupplier; |
379 |
||
49765 | 380 |
public InputStreamPublisher(Supplier<? extends InputStream> streamSupplier) { |
48379
5382baab8371
8193698: Null handling in BodyPublisher, BodyHandler, and BodySubscriber convenience static factory methods
chegar
parents:
48083
diff
changeset
|
381 |
this.streamSupplier = Objects.requireNonNull(streamSupplier); |
48083 | 382 |
} |
383 |
||
384 |
@Override |
|
385 |
public void subscribe(Flow.Subscriber<? super ByteBuffer> subscriber) { |
|
386 |
PullPublisher<ByteBuffer> publisher; |
|
387 |
InputStream is = streamSupplier.get(); |
|
388 |
if (is == null) { |
|
389 |
Throwable t = new IOException("streamSupplier returned null"); |
|
390 |
publisher = new PullPublisher<>(null, t); |
|
391 |
} else { |
|
392 |
publisher = new PullPublisher<>(iterableOf(is), null); |
|
393 |
} |
|
394 |
publisher.subscribe(subscriber); |
|
395 |
} |
|
396 |
||
397 |
protected Iterable<ByteBuffer> iterableOf(InputStream is) { |
|
398 |
return () -> new StreamIterator(is); |
|
399 |
} |
|
400 |
||
401 |
@Override |
|
402 |
public long contentLength() { |
|
403 |
return -1; |
|
404 |
} |
|
405 |
} |
|
48408
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
406 |
|
49765 | 407 |
public static final class PublisherAdapter implements BodyPublisher { |
48408
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
408 |
|
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
409 |
private final Publisher<? extends ByteBuffer> publisher; |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
410 |
private final long contentLength; |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
411 |
|
49765 | 412 |
public PublisherAdapter(Publisher<? extends ByteBuffer> publisher, |
48408
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
413 |
long contentLength) { |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
414 |
this.publisher = Objects.requireNonNull(publisher); |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
415 |
this.contentLength = contentLength; |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
416 |
} |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
417 |
|
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
418 |
@Override |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
419 |
public final long contentLength() { |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
420 |
return contentLength; |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
421 |
} |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
422 |
|
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
423 |
@Override |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
424 |
public final void subscribe(Flow.Subscriber<? super ByteBuffer> subscriber) { |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
425 |
publisher.subscribe(subscriber); |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
426 |
} |
4f830b447edf
8193365: Improve interoperability between HTTP Client's BodyPublisher/BodySubscriber and Flow.Subscriber/Publisher
chegar
parents:
48379
diff
changeset
|
427 |
} |
48083 | 428 |
} |