Class ServiceInputConnection

    • Constructor Detail

      • ServiceInputConnection

        public ServiceInputConnection()
        Create a new service input connection.
    • Method Detail

      • read

        public int read()
        Non-blocking read. Tries to read the next byte.
        Specified by:
        read in interface IInputConnection
        Returns:
        The next byte or -1 if none is currently available.
      • read

        public int read​(byte[] buffer)
        Non-blocking read. Tries to fill the buffer from the stream.
        Specified by:
        read in interface IInputConnection
        Parameters:
        buffer - The buffer to read in.
        Returns:
        The number of bytes that could be read into the buffer.
      • available

        public int available()
        Get the number of available bytes.
        Specified by:
        available in interface IInputConnection
        Returns:
        The number of available bytes.
      • getConnectionId

        public int getConnectionId()
        Get the connection id.
        Specified by:
        getConnectionId in interface IConnection
        Returns:
        The connection id.
      • close

        public void close()
        Close the stream.
        Specified by:
        close in interface IConnection
      • getNonFunctionalProperties

        public java.util.Map<java.lang.String,​java.lang.Object> getNonFunctionalProperties()
        Get the non-functional properties of the connection.
        Specified by:
        getNonFunctionalProperties in interface IConnection
      • setInputConnection

        protected void setInputConnection​(IInputConnection con)
        Set the input connection.
      • getOutputConnection

        public IOutputConnection getOutputConnection()
        Get the corresponding output connection.
      • writeToOutputStream

        public ISubscriptionIntermediateFuture<java.lang.Long> writeToOutputStream​(java.io.OutputStream os,
                                                                                   IExternalAccess component)
        Read all data from output stream to the connection. The result is an intermediate future that reports back the size that was read. It can also be used to terminate reading.
        Specified by:
        writeToOutputStream in interface IInputConnection
        Parameters:
        is - The input stream.
        component - The component.