Returns a new {@link ByteSink} for writing bytes to the given file. The given {@code modes} control how the file is opened for writing. When no mode is provided, the file will be truncated before writing. When the {@link FileWriteMode#APPEND APPEND} mode is provided, writes will append to the end of
(File file, FileWriteMode... modes)
| 176 | * @since 14.0 |
| 177 | */ |
| 178 | public static ByteSink asByteSink(File file, FileWriteMode... modes) { |
| 179 | return new FileByteSink(file, modes); |
| 180 | } |
| 181 | |
| 182 | private static final class FileByteSink extends ByteSink { |
| 183 |
no outgoing calls