java.lang.Object
org.cryptomator.frontend.fuse.FileChannelUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidtruncateOrExpand(FileChannel channel, long size) Truncates this channel's file to the given size by following the POSIX standard.
-
Constructor Details
-
FileChannelUtil
public FileChannelUtil()
-
-
Method Details
-
truncateOrExpand
Truncates this channel's file to the given size by following the POSIX standard.Unlike
FileChannel.truncate(long size), this implementation extends the file if it is shorter by using zero bytes as defined in the POSIX standard.- Parameters:
channel- channel's filesize- target size- Throws:
IOException- If an exception occurs during truncate or write.
-