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:
FileOutput<T>,Output<T>,java.io.Closeable,java.lang.AutoCloseable
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.FileOutput
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.PathgetFilePath()BinFileInput<T>getInput()Make aInputinstance from this.java.lang.StringtoString()
-
-
-
Constructor Detail
-
BinFileOutput
public BinFileOutput(java.nio.file.Path dstPath) throws java.io.IOException- 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() throws java.io.IOExceptionOpens the temporary output file with ".bin" extension and random name.- Throws:
java.io.IOException
-
-
Method Detail
-
getInput
public BinFileInput<T> getInput() throws java.io.IOException
Description copied from interface:OutputMake aInputinstance from this.
-
getFilePath
public final java.nio.file.Path getFilePath()
- Specified by:
getFilePathin interfaceFileOutput<T>
-
-