Fix exceptions for readers, add path writer.

This commit is contained in:
Holt59
2018-02-24 15:11:15 +01:00
parent 164a9d4494
commit 6c3bc23984
7 changed files with 194 additions and 96 deletions

View File

@@ -0,0 +1,30 @@
package org.insa.graph.io;
import java.io.DataOutputStream;
import java.io.IOException;
public abstract class BinaryWriter {
// Output stream.
protected DataOutputStream dos;
/**
* @param dos
*/
protected BinaryWriter(DataOutputStream dos) {
this.dos = dos;
}
/**
* Write a 24-bits integer in BigEndian to the output stream.
*
* @param value
*
* @throws IOException
*/
protected void write24bits(int value) throws IOException {
dos.writeShort(value >> 8);
dos.writeByte(value & 0xff);
}
}