MCPcopy Create free account
hub / github.com/core-lib/xjar / transfer

Method transfer

src/main/java/io/xjar/XKit.java:120–130  ·  view source on GitHub ↗

输入流传输到输出流 @param in 输入流 @param out 输出流 @return 传输长度 @throws IOException I/O 异常

(InputStream in, OutputStream out)

Source from the content-addressed store, hash-verified

118 * @throws IOException I/O 异常
119 */
120 public static long transfer(InputStream in, OutputStream out) throws IOException {
121 long total = 0;
122 byte[] buffer = new byte[4096];
123 int length;
124 while ((length = in.read(buffer)) != -1) {
125 out.write(buffer, 0, length);
126 total += length;
127 }
128 out.flush();
129 return total;
130 }
131
132 /**
133 * reader传输到writer

Callers 14

encryptMethod · 0.95
injectMethod · 0.95
decryptMethod · 0.95
decryptMethod · 0.95
readMethod · 0.95
encryptMethod · 0.95
decryptMethod · 0.95
encryptMethod · 0.95
encryptMethod · 0.95
decryptMethod · 0.95
findClassMethod · 0.95
findClassMethod · 0.95

Calls 4

closeMethod · 0.95
flushMethod · 0.80
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected