Class NamedWriteableAwareStreamInput

    • Method Detail

      • readNamedWriteable

        public <C extends NamedWriteable> C readNamedWriteable​(java.lang.Class<C> categoryClass)
                                                        throws java.io.IOException
        Description copied from class: StreamInput
        Reads a NamedWriteable from the current stream, by first reading its name and then looking for the corresponding entry in the registry by name, so that the proper object can be read and returned. Default implementation throws UnsupportedOperationException as StreamInput doesn't hold a registry. Use FilterInputStream instead which wraps a stream and supports a NamedWriteableRegistry too.
        Overrides:
        readNamedWriteable in class StreamInput
        Throws:
        java.io.IOException
      • readNamedWriteable

        public <C extends NamedWriteable> C readNamedWriteable​(java.lang.Class<C> categoryClass,
                                                               java.lang.String name)
                                                        throws java.io.IOException
        Description copied from class: StreamInput
        Reads a NamedWriteable from the current stream with the given name. It is assumed that the caller obtained the name from other source, so it's not read from the stream. The name is used for looking for the corresponding entry in the registry by name, so that the proper object can be read and returned. Default implementation throws UnsupportedOperationException as StreamInput doesn't hold a registry. Use FilterInputStream instead which wraps a stream and supports a NamedWriteableRegistry too. Prefer StreamInput.readNamedWriteable(Class) and StreamOutput.writeNamedWriteable(NamedWriteable) unless you have a compelling reason to use this method instead.
        Overrides:
        readNamedWriteable in class StreamInput
        Throws:
        java.io.IOException