Package org.ojalgo.netio
Class DataWriter<T>
java.lang.Object
org.ojalgo.netio.DataWriter<T>
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ToFileWriter<T>
A
DataOutput
based ToFileWriter
. You have to construct and supply a custom
DataWriter.Serializer
instance to use this writer.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.ojalgo.netio.ToFileWriter
ToFileWriter.Builder<F>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DataOutputStream
private final DataWriter.Serializer
<T> Fields inherited from interface org.ojalgo.netio.ToFileWriter
NULL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static <T> DataWriter
<T> of
(File file, DataWriter.Serializer<T> serializer) static <T> DataWriter
<T> of
(File file, DataWriter.Serializer<T> serializer, OperatorWithException<OutputStream> filter) static <T> DataWriter
<T> of
(InMemoryFile file, DataWriter.Serializer<T> serializer) static <T> DataWriter
<T> of
(InMemoryFile file, DataWriter.Serializer<T> serializer, OperatorWithException<OutputStream> filter) void
Write the item to the consumer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ojalgo.netio.ToFileWriter
writeBatch
-
Field Details
-
myOutput
-
mySerializer
-
-
Constructor Details
-
DataWriter
-
-
Method Details
-
of
-
of
public static <T> DataWriter<T> of(File file, DataWriter.Serializer<T> serializer, OperatorWithException<OutputStream> filter) -
of
-
of
public static <T> DataWriter<T> of(InMemoryFile file, DataWriter.Serializer<T> serializer, OperatorWithException<OutputStream> filter) -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceToFileWriter<T>
- Throws:
IOException
-
write
Description copied from interface:ToFileWriter
Write the item to the consumer.- Specified by:
write
in interfaceToFileWriter<T>
- Parameters:
itemToWrite
- The item to be written
-