MCPcopy Index your code
hub / github.com/antlr/codebuff / toByteArray

Method toByteArray

output/java_guava/1.4.17/ByteStreams.java:166–173  ·  view source on GitHub ↗

Reads all bytes from an input stream into a byte array. Does not close the stream. @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

164
165
166 public static byte[] toByteArray(InputStream in) throws IOException {
167 // Presize the ByteArrayOutputStream since we know how large it will need
168 // to be, unless that value is less than the default ByteArrayOutputStream
169 // size (32).
170 ByteArrayOutputStream out = new ByteArrayOutputStream(Math.max(32, in.available()));
171 copy(in, out);
172 return out.toByteArray();
173 }
174
175 /**
176 * Reads all bytes from an input stream into a byte array. The given expected size is used to

Callers 2

readMethod · 0.95
readFileMethod · 0.95

Calls 9

copyMethod · 0.95
writeToMethod · 0.95
toByteArrayMethod · 0.65
writeMethod · 0.65
sizeMethod · 0.65
maxMethod · 0.45
availableMethod · 0.45
readMethod · 0.45
copyOfMethod · 0.45

Tested by

no test coverage detected