Class NamedWriteableAwareStreamInput

java.lang.Object
java.io.InputStream
org.elasticsearch.common.io.stream.StreamInput
org.elasticsearch.common.io.stream.FilterStreamInput
org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

public class NamedWriteableAwareStreamInput
extends FilterStreamInput
Wraps a StreamInput and associates it with a NamedWriteableRegistry
  • Constructor Details

  • Method Details

    • 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
    • namedWriteableRegistry

      public NamedWriteableRegistry namedWriteableRegistry()
      Description copied from class: StreamInput
      Get the registry of named writeables if this stream has one, null otherwise.
      Overrides:
      namedWriteableRegistry in class FilterStreamInput