Interface MessageReader

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    FileMessageReader, IOMessageReader

    public interface MessageReader
    extends java.io.Closeable
    An interface for reading messages and service calls.
    • Method Detail

      • read

        <Message extends PMessage<Message,​Field>,​Field extends PField> Message read​(PMessageDescriptor<Message,​Field> descriptor)
                                                                                         throws java.io.IOException
        Read a message from the stream.
        Type Parameters:
        Message - The message type.
        Field - The message field type.
        Parameters:
        descriptor - The descriptor for the message to be read.
        Returns:
        The message read.
        Throws:
        java.io.IOException - If the message could not be read.
      • read

        <Message extends PMessage<Message,​Field>,​Field extends PFieldPServiceCall<Message,​Field> read​(PService service)
                                                                                                                   throws java.io.IOException
        Read a service call from the stream.
        Type Parameters:
        Message - The type of the contained params or response message.
        Field - The field type of the contained params or response message.
        Parameters:
        service - The service whose call should be read.
        Returns:
        The service call read.
        Throws:
        java.io.IOException - If the service call could not be read.