Module com.github.akurilov.commons
Class BinFileOutput<T>
- java.lang.Object
-
- com.github.akurilov.commons.io.BinOutput<T>
-
- com.github.akurilov.commons.io.file.BinFileOutput<T>
-
- All Implemented Interfaces:
FileIo,FileOutput<T>,Output<T>,java.lang.AutoCloseable,java.util.function.Consumer<T>
public class BinFileOutput<T> extends BinOutput<T> implements FileOutput<T>
An item input implementation serializing something to the specified file.
WARNING: doesn't support the appending of the previously used output file (already containing the data which had been output earlier). This limitation is due to Java serialization, which adds the new header on each new ObjectOutputStream instance.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.file.PathdstPath-
Fields inherited from interface com.github.akurilov.commons.io.file.FileIo
INPUT_OPEN_OPTIONS, OUTPUT_OPEN_OPTIONS
-
-
Constructor Summary
Constructors Constructor Description BinFileOutput()Opens the temporary output file with ".bin" extension and random name.BinFileOutput(java.nio.file.Path dstPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.file.PathfilePath()BinFileInput<T>getInput()Make aInputinstance from this.java.lang.StringtoString()
-
-
-
Constructor Detail
-
BinFileOutput
public BinFileOutput(java.nio.file.Path dstPath)
- Parameters:
dstPath- the path to the file which should be used to store the serialized items- Throws:
java.io.IOException- if unable to open the file for writing
-
BinFileOutput
public BinFileOutput()
Opens the temporary output file with ".bin" extension and random name.
-
-
Method Detail
-
getInput
public BinFileInput<T> getInput()
Description copied from interface:OutputMake aInputinstance from this.
-
-