Class BinaryPathReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, PathReader

    public class BinaryPathReader
    extends BinaryReader
    implements PathReader
    Implementation of PathReader to read paths in binary format.
    • Constructor Detail

      • BinaryPathReader

        public BinaryPathReader​(java.io.DataInputStream dis)
        Create a new BinaryPathReader that read from the given input stream.
        Parameters:
        dis - Input stream to read from.
    • Method Detail

      • readPath

        public Path readPath​(Graph graph)
                      throws java.io.IOException
        Description copied from interface: PathReader
        Read a path of the given graph and returns it.
        Specified by:
        readPath in interface PathReader
        Parameters:
        graph - Graph of the path.
        Returns:
        Path read.
        Throws:
        java.io.IOException - When an error occurs while reading the path.
      • readNode

        protected Node readNode​(Graph graph)
                         throws java.io.IOException
        Read a node from the input stream and returns it.
        Parameters:
        graph - Graph containing the nodes.
        Returns:
        The next node in the input stream.
        Throws:
        java.io.IOException - if something occurs while reading the note.
        java.lang.IndexOutOfBoundsException - if the node is not in the graph.