MCPcopy
hub / github.com/google/guava / toByteArray

Method toByteArray

guava/src/com/google/common/io/ByteStreams.java:240–243  ·  view source on GitHub ↗

Reads all bytes from an input stream into a byte array. Does not close the stream. <p><b>Java 9+ users:</b> use {@code in#readAllBytes()} instead. @param in the input stream to read from @return a byte array containing all the bytes from the stream @throws IOException if an I/O error occurs

(InputStream in)

Source from the content-addressed store, hash-verified

238 * @throws IOException if an I/O error occurs
239 */
240 public static byte[] toByteArray(InputStream in) throws IOException {
241 checkNotNull(in);
242 return toByteArrayInternal(in, new ArrayDeque<byte[]>(TO_BYTE_ARRAY_DEQUE_SIZE), 0);
243 }
244
245 /**
246 * Reads all bytes from an input stream into a byte array. The given expected size is used to

Calls 6

toByteArrayInternalMethod · 0.95
addMethod · 0.65
checkNotNullMethod · 0.45
checkArgumentMethod · 0.45
readMethod · 0.45
copyOfMethod · 0.45

Tested by

no test coverage detected