com.sap.hana.datalake.files.utils.IOUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sap-hdlfs Show documentation
Show all versions of sap-hdlfs Show documentation
An implementation of org.apache.hadoop.fs.FileSystem targeting SAP HANA Data Lake Files.
// © 2024 SAP SE or an SAP affiliate company. All rights reserved.
package com.sap.hana.datalake.files.utils;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
public class IOUtils {
private IOUtils() {
// no-op
}
public static long copyBytesTo(final InputStream is, final OutputStream os, final int limit) throws IOException {
if (is.markSupported()) {
is.mark(/* ignored */ 0);
}
try {
return org.apache.commons.io.IOUtils.copyLarge(is, os, /* inputOffset */ 0L, limit);
} finally {
if (is.markSupported()) {
is.reset();
}
}
}
}
// © 2024 SAP SE or an SAP affiliate company. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy