Package com.helger.commons.io.file
Class FileChannelHelper
- java.lang.Object
-
- com.helger.commons.io.file.FileChannelHelper
-
@Immutable public final class FileChannelHelper extends Object
MiscellaneousFileChannelutility methods.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FileChannelgetFileReadChannel(File aFile)static FileChannelgetFileReadChannel(String sFilename)static longgetFileSize(FileChannel aChannel)static FileChannelgetFileWriteChannel(File aFile)static FileChannelgetFileWriteChannel(File aFile, EAppend eAppend)static FileChannelgetFileWriteChannel(String sFilename)static FileChannelgetFileWriteChannel(String sFilename, EAppend eAppend)static InputStreamgetInputStream(File aFile)static InputStreamgetMappedInputStream(File aFile)Get an input stream to the specified file, using memory mapping.static OutputStreamgetMappedOutputStream(File aFile)static OutputStreamgetMappedOutputStream(File aFile, EAppend eAppend)static OutputStreamgetMappedOutputStream(String sFilename)static OutputStreamgetMappedOutputStream(String sFilename, EAppend eAppend)
-
-
-
Method Detail
-
getFileSize
@CheckForSigned public static long getFileSize(@Nullable FileChannel aChannel)
-
getInputStream
@Nullable public static InputStream getInputStream(@Nonnull File aFile)
-
getFileReadChannel
@Nullable public static FileChannel getFileReadChannel(@Nonnull String sFilename)
-
getFileReadChannel
@Nullable public static FileChannel getFileReadChannel(@Nonnull File aFile)
-
getMappedInputStream
@Nullable public static InputStream getMappedInputStream(@Nonnull File aFile)
Get an input stream to the specified file, using memory mapping. If memory mapping fails, a regularFileInputStreamis returned.- Parameters:
aFile- The file to use. May not benull.- Returns:
- The Input stream to use.
-
getFileWriteChannel
@Nullable public static FileChannel getFileWriteChannel(@Nonnull String sFilename)
-
getFileWriteChannel
@Nullable public static FileChannel getFileWriteChannel(@Nonnull String sFilename, @Nonnull EAppend eAppend)
-
getFileWriteChannel
@Nullable public static FileChannel getFileWriteChannel(@Nonnull File aFile)
-
getFileWriteChannel
@Nullable public static FileChannel getFileWriteChannel(@Nonnull File aFile, @Nonnull EAppend eAppend)
-
getMappedOutputStream
@Nullable public static OutputStream getMappedOutputStream(@Nonnull String sFilename)
-
getMappedOutputStream
@Nullable public static OutputStream getMappedOutputStream(@Nonnull String sFilename, @Nonnull EAppend eAppend)
-
getMappedOutputStream
@Nullable public static OutputStream getMappedOutputStream(@Nonnull File aFile)
-
-