@Immutable public final class FileChannelHelper extends Object
FileChannel utility methods.| Modifier and Type | Method and Description |
|---|---|
static FileChannel |
getFileReadChannel(File aFile) |
static FileChannel |
getFileReadChannel(String sFilename) |
static long |
getFileSize(FileChannel aChannel) |
static FileChannel |
getFileWriteChannel(File aFile) |
static FileChannel |
getFileWriteChannel(File aFile,
EAppend eAppend) |
static FileChannel |
getFileWriteChannel(String sFilename) |
static FileChannel |
getFileWriteChannel(String sFilename,
EAppend eAppend) |
static InputStream |
getInputStream(File aFile) |
static InputStream |
getMappedInputStream(File aFile)
Get an input stream to the specified file, using memory mapping.
|
static OutputStream |
getMappedOutputStream(File aFile) |
static OutputStream |
getMappedOutputStream(File aFile,
EAppend eAppend) |
static OutputStream |
getMappedOutputStream(String sFilename) |
static OutputStream |
getMappedOutputStream(String sFilename,
EAppend eAppend) |
@CheckForSigned public static long getFileSize(@Nullable FileChannel aChannel)
@Nullable public static InputStream getInputStream(@Nonnull File aFile)
@Nullable public static FileChannel getFileReadChannel(@Nonnull String sFilename)
@Nullable public static FileChannel getFileReadChannel(@Nonnull File aFile)
@Nullable public static InputStream getMappedInputStream(@Nonnull File aFile)
FileInputStream is returned.aFile - The file to use. May not be null.@Nullable public static FileChannel getFileWriteChannel(@Nonnull String sFilename)
@Nullable public static FileChannel getFileWriteChannel(@Nonnull String sFilename, @Nonnull EAppend eAppend)
@Nullable public static FileChannel getFileWriteChannel(@Nonnull File aFile)
@Nullable public static FileChannel getFileWriteChannel(@Nonnull File aFile, @Nonnull EAppend eAppend)
@Nullable public static OutputStream getMappedOutputStream(@Nonnull String sFilename)
@Nullable public static OutputStream getMappedOutputStream(@Nonnull String sFilename, @Nonnull EAppend eAppend)
@Nullable public static OutputStream getMappedOutputStream(@Nonnull File aFile)
Copyright © 2014–2022 Philip Helger. All rights reserved.