Update javadoc and clean naming.

This commit is contained in:
Mikael Capelle
2018-03-07 17:10:02 +01:00
parent 17fb363493
commit 85fb193808
14 changed files with 237 additions and 142 deletions

View File

@@ -3,24 +3,30 @@ package org.insa.graph.io;
import java.io.DataOutputStream;
import java.io.IOException;
/**
* Base class for writing binary file.
*
*/
public abstract class BinaryWriter {
// Output stream.
protected DataOutputStream dos;
/**
* @param dos
* Create a new BinaryWriter that writes to the given output stream.
*
* @param dos Stream to write to.
*/
protected BinaryWriter(DataOutputStream dos) {
this.dos = dos;
}
/**
* Write a 24-bits integer in BigEndian to the output stream.
* Write a 24-bits integer in BigEndian order to the output stream.
*
* @param value
* @param value Value to write.
*
* @throws IOException
* @throws IOException if an error occurs while writing to the stream.
*/
protected void write24bits(int value) throws IOException {
dos.writeShort(value >> 8);