Interface Transmission

    • Method Detail

      • getLength

        int getLength()
        Determines the overall length of this Transmission. In case of nested Transmission instances, all length values from all sub-segments are accumulated to the result as well.
        Specified by:
        getLength in interface org.refcodes.mixin.LengthAccessor
        Returns:
        The (overall) length of the Transmission (including any sub-segments).
      • transmitTo

        void transmitTo​(OutputStream aOutputStream,
                        InputStream aReturnStream)
                 throws IOException
        Transmits the Sequence representing the implementing type's instance to the given OutputStream. Implementations providing error correction methods use the provided feedback InputStream to do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the transmitted data.
        Parameters:
        aOutputStream - The OutputStream where to write this instance's Sequence to.
        aReturnStream - An InputStream being the return channel to handle "stop-and-wait ARQ" or the like in case of a bidirectional connection. Can be null in case we have a unidirectional connection.
        Throws:
        IOException - thrown in case writing data to the OutputStream caused problems.
      • toSimpleTypeMap

        org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()
        Returns the SimpleTypeMap representation of this Transmission. In case this Transmission has Transmission children, then the children are queried as well and contained in the resulting SimpleTypeMap. The aliases of the according Transmission instances represent the resulting path to a Transmission's final simple type.
        Returns:
        The SimpleTypeMap representing this Transmission and (if any) its children, with the according aliases forming the paths to the Transmission's values.
      • fromInputStream

        static byte[] fromInputStream​(InputStream aInputStream,
                                      int aLength)
                               throws IOException
        Retrieves the number of bytes from the given InputStream by also trying to read the required number of bytes in chunks (in case not all bytes can be read in one take).
        Parameters:
        aInputStream - The byte array data from which to retrieve the bytes.
        aLength - The number of bytes to be retrieved.
        Returns:
        An array containing the number of bytes.
        Throws:
        IOException - thrown in case reading data from the InputStream caused problems.