MCPcopy Index your code
hub / github.com/OpenFeign/feign / InputStreamBody

Class InputStreamBody

core/src/main/java/feign/Response.java:282–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280 }
281
282 private static final class InputStreamBody implements Response.Body {
283
284 private final InputStream inputStream;
285 private final Integer length;
286
287 private InputStreamBody(InputStream inputStream, Integer length) {
288 this.inputStream = inputStream;
289 this.length = length;
290 }
291
292 private static Body orNull(InputStream inputStream, Integer length) {
293 if (inputStream == null) {
294 return null;
295 }
296 return new InputStreamBody(inputStream, length);
297 }
298
299 @Override
300 public Integer length() {
301 return length;
302 }
303
304 @Override
305 public boolean isRepeatable() {
306 return false;
307 }
308
309 @Override
310 public InputStream asInputStream() {
311 return inputStream;
312 }
313
314 @SuppressWarnings("deprecation")
315 @Override
316 public Reader asReader() {
317 return new InputStreamReader(inputStream, UTF_8);
318 }
319
320 @Override
321 public Reader asReader(Charset charset) {
322 checkNotNull(charset, "charset should not be null");
323 return new InputStreamReader(inputStream, charset);
324 }
325
326 @Override
327 public void close() throws IOException {
328 inputStream.close();
329 }
330 }
331
332 private static final class ByteArrayBody implements Response.Body {
333

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected