Package org.insa.graphs.model.io
Class BinaryWriter
- java.lang.Object
-
- org.insa.graphs.model.io.BinaryWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
BinaryPathWriter
public abstract class BinaryWriter extends java.lang.Object implements java.lang.AutoCloseable, java.io.Closeable
Base class for writing binary file.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.DataOutputStream
dos
-
Constructor Summary
Constructors Modifier Constructor Description protected
BinaryWriter(java.io.DataOutputStream dos)
Create a new BinaryWriter that writes to the given output stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected void
write24bits(int value)
Write a 24-bits integer in BigEndian order to the output stream.
-
-
-
Method Detail
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
write24bits
protected void write24bits(int value) throws java.io.IOException
Write a 24-bits integer in BigEndian order to the output stream.- Parameters:
value
- Value to write.- Throws:
java.io.IOException
- if an error occurs while writing to the stream.
-
-