public class TransformerStorage extends Object implements TransformerBinaryStorage
Constructor and Description |
---|
TransformerStorage(BinaryStorageBase baseStorage) |
Modifier and Type | Method and Description |
---|---|
void |
createDirectories(Path... paths)
Create directories on file system.
|
Function<File,byte[]> |
fileReader()
Constructs reader function that reads content from a file as array of bytes.
|
BiConsumer<File,byte[]> |
fileWriter()
Constructs writer function that writes array of bytes to a file.
|
BiConsumer<Writer,File> |
flushWriter()
Flushes writer to the file.
|
BiFunction<File,String,Writer> |
getWriter()
Constructs a function that returns writer for a given
outputFile
possibly using charsetName when non-null. |
public TransformerStorage(BinaryStorageBase baseStorage)
public Function<File,byte[]> fileReader()
TransformerBinaryStorage
fileReader
in interface TransformerBinaryStorage
File
and returns byte[]
array.public BiConsumer<File,byte[]> fileWriter()
TransformerBinaryStorage
fileWriter
in interface TransformerBinaryStorage
File
as a destination parameter
and byte[]
array that should be written to the destination.public BiFunction<File,String,Writer> getWriter()
TransformerBinaryStorage
outputFile
possibly using charsetName
when non-null.getWriter
in interface TransformerBinaryStorage
Lambda arguments:
File
were the writer should writes to;String
encoding. When non-null used when writing to the output file;Writer
an initialized writer.public BiConsumer<Writer,File> flushWriter()
TransformerBinaryStorage
flushWriter
in interface TransformerBinaryStorage
Writer
with content
and target File
.public void createDirectories(Path... paths) throws IOException
TransformerBinaryStorage
createDirectories
in interface TransformerBinaryStorage
paths
- paths to create.IOException
- creating is failed.Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries