Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • dos

        protected final java.io.DataOutputStream dos
    • Constructor Detail

      • BinaryWriter

        protected BinaryWriter​(java.io.DataOutputStream dos)
        Create a new BinaryWriter that writes to the given output stream.
        Parameters:
        dos - Stream to write to.
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.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.