use of org.apache.pulsar.functions.worker.dlog.DLInputStream in project incubator-pulsar by apache.
the class Utils method downloadFromBookkeeper.
public static void downloadFromBookkeeper(Namespace namespace, OutputStream outputStream, String packagePath) throws Exception {
DistributedLogManager dlm = namespace.openLog(packagePath);
InputStream in = new DLInputStream(dlm);
int read = 0;
byte[] bytes = new byte[1024];
while ((read = in.read(bytes)) != -1) {
outputStream.write(bytes, 0, read);
}
outputStream.flush();
}
Aggregations