Terracotta | 陶瓦联机 (#4215)
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
This commit is contained in:
@@ -424,7 +424,7 @@ public abstract class FetchTask<T> extends Task<T> {
|
||||
|
||||
public abstract void write(byte[] buffer, int offset, int len) throws IOException;
|
||||
|
||||
public final void withResult(boolean success) {
|
||||
public void withResult(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
package org.jackhuang.hmcl.util.io;
|
||||
|
||||
import org.jackhuang.hmcl.util.function.ExceptionalPredicate;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.Charset;
|
||||
@@ -153,6 +154,31 @@ public final class Zipper implements Closeable {
|
||||
zos.closeEntry();
|
||||
}
|
||||
|
||||
public OutputStream putStream(String path) throws IOException {
|
||||
zos.putNextEntry(new ZipEntry(normalize(path)));
|
||||
return new OutputStream() {
|
||||
public void write(int b) throws IOException {
|
||||
zos.write(b);
|
||||
}
|
||||
|
||||
public void write(@NotNull byte[] b) throws IOException {
|
||||
zos.write(b);
|
||||
}
|
||||
|
||||
public void write(@NotNull byte[] b, int off, int len) throws IOException {
|
||||
zos.write(b, off, len);
|
||||
}
|
||||
|
||||
public void flush() throws IOException {
|
||||
zos.flush();
|
||||
}
|
||||
|
||||
public void close() throws IOException {
|
||||
zos.closeEntry();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void putLines(Stream<String> lines, String path) throws IOException {
|
||||
zos.putNextEntry(new ZipEntry(normalize(path)));
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ public final class SystemUtils {
|
||||
return Thread.currentThread().getContextClassLoader().getResource("com/sun/tools/attach/VirtualMachine.class") != null;
|
||||
}
|
||||
|
||||
private static void onLogLine(String log) {
|
||||
public static void onLogLine(String log) {
|
||||
LOG.info(log);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user