Class StreamDatabaseInterface

    • Field Detail

      • out

        protected java.io.DataOutputStream out
        The data output stream for the db protocol.
      • in

        protected java.io.DataInputStream in
        The data input stream for the db protocol.
      • closed

        private boolean closed
    • Constructor Detail

      • StreamDatabaseInterface

        StreamDatabaseInterface()
    • Method Detail

      • setup

        void setup​(java.io.InputStream rawin,
                   java.io.OutputStream rawout)
            throws java.io.IOException
        Sets up the stream connection with the given input/output stream.
        Throws:
        java.io.IOException
      • writeCommandToServer

        void writeCommandToServer​(byte[] command,
                                  int offset,
                                  int size)
                           throws java.io.IOException
        Writes the given command to the server. The stream protocol flushes the byte array onto the stream.
        Specified by:
        writeCommandToServer in class RemoteDatabaseInterface
        Throws:
        java.io.IOException
      • nextCommandFromServer

        byte[] nextCommandFromServer​(int timeout)
                              throws java.io.IOException
        Blocks until the next command is received from the server. The stream protocol waits until we receive something from the server.
        Specified by:
        nextCommandFromServer in class RemoteDatabaseInterface
        Throws:
        java.io.IOException