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

Method toByteArray

core/src/main/java/feign/Util.java:257–266  ·  view source on GitHub ↗

Adapted from com.google.common.io.ByteStreams.toByteArray().

(InputStream in)

Source from the content-addressed store, hash-verified

255
256 /** Adapted from {@code com.google.common.io.ByteStreams.toByteArray()}. */
257 public static byte[] toByteArray(InputStream in) throws IOException {
258 checkNotNull(in, "in");
259 try {
260 ByteArrayOutputStream out = new ByteArrayOutputStream();
261 copy(in, out);
262 return out.toByteArray();
263 } finally {
264 ensureClosed(in);
265 }
266 }
267
268 /** Adapted from {@code com.google.common.io.ByteStreams.copy()}. */
269 private static long copy(InputStream from, OutputStream to) throws IOException {

Callers 15

hasGzippedBodyMethod · 0.95
hasDeflatedBodyMethod · 0.95
errorStatusMethod · 0.95
decodeMethod · 0.95
okMethod · 0.95
addMethod · 0.95
encodeMethod · 0.45
compressMethod · 0.45

Calls 3

checkNotNullMethod · 0.95
copyMethod · 0.95
ensureClosedMethod · 0.95

Tested by 9

hasGzippedBodyMethod · 0.76
hasDeflatedBodyMethod · 0.76
compressMethod · 0.36
deflateMethod · 0.36
setupMethod · 0.36
setupMethod · 0.36
decodesMethod · 0.36