Package org.apache.spark.util
Interface SparkStreamUtils
public interface SparkStreamUtils
-
Method Summary
Modifier and TypeMethodDescriptionvoid
copyFileStreamNIO
(FileChannel input, WritableByteChannel output, long startPosition, long bytesToCopy) long
copyStream
(InputStream in, OutputStream out, boolean closeStreams, boolean transferToEnabled) Copy all data from an InputStream to an OutputStream.
-
Method Details
-
copyStream
Copy all data from an InputStream to an OutputStream. NIO way of file stream to file stream copying is disabled by default unless explicitly set transferToEnabled as true, the parameter transferToEnabled should be configured by spark.file.transferTo = [true|false].- Parameters:
in
- (undocumented)out
- (undocumented)closeStreams
- (undocumented)transferToEnabled
- (undocumented)- Returns:
- (undocumented)
-
copyFileStreamNIO
void copyFileStreamNIO(FileChannel input, WritableByteChannel output, long startPosition, long bytesToCopy)
-