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

Method readBytes

output/java_guava/1.4.19/ByteStreams.java:846–856  ·  view source on GitHub ↗

Process the bytes of the given input stream using the given processor. @param input the input stream to process @param processor the object to which to pass the bytes of the stream @return the result of the byte processor @throws IOException if an I/O error occurs @since 14.0

(InputStream input, ByteProcessor<T> processor)

Source from the content-addressed store, hash-verified

844 */
845
846 @CanIgnoreReturnValue // some processors won't return a useful result
847 public static <T> T readBytes(InputStream input, ByteProcessor<T> processor) throws IOException {
848 checkNotNull(input);
849 checkNotNull(processor);
850 byte[] buf = createBuffer();
851 int read;
852 do {
853 read = input.read(buf);
854 } while (read != -1 && processor.processBytes(buf, 0, read));
855 return processor.getResult();
856 }
857
858 /**
859 * Reads some bytes from an input stream and stores them into the buffer array {@code b}. This

Callers 1

readMethod · 0.95

Calls 5

createBufferMethod · 0.95
processBytesMethod · 0.65
getResultMethod · 0.65
checkNotNullMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected