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 aStreamInput
and associates it with aNamedWriteableRegistry
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.common.io.stream.FilterStreamInput
delegate
-
-
Constructor Summary
Constructors Constructor Description NamedWriteableAwareStreamInput(StreamInput delegate, NamedWriteableRegistry namedWriteableRegistry)
-
Method Summary
Modifier and Type Method Description <C extends NamedWriteable>
CreadNamedWriteable(java.lang.Class<C> categoryClass)
Reads aNamedWriteable
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.<C extends NamedWriteable>
CreadNamedWriteable(java.lang.Class<C> categoryClass, java.lang.String name)
Reads aNamedWriteable
from the current stream with the given name.-
Methods inherited from class org.elasticsearch.common.io.stream.FilterStreamInput
available, close, ensureCanReadBytes, getVersion, read, readByte, readBytes, reset, setVersion
-
Methods inherited from class org.elasticsearch.common.io.stream.StreamInput
readArray, readBoolean, readByteArray, readBytesRef, readBytesRef, readBytesReference, readBytesReference, readDouble, readDoubleArray, readEnum, readEnumSet, readException, readFloat, readFloatArray, readFully, readGenericValue, readGeoPoint, readInstant, readInt, readIntArray, readList, readLong, readLongArray, readMap, readMap, readMapOfLists, readNamedWriteableList, readOptionalArray, readOptionalBoolean, readOptionalBytesReference, readOptionalDouble, readOptionalFloat, readOptionalInstant, readOptionalLong, readOptionalNamedWriteable, readOptionalStreamable, readOptionalString, readOptionalStringArray, readOptionalText, readOptionalTimeValue, readOptionalTimeZone, readOptionalVInt, readOptionalWriteable, readSet, readShort, readStreamableList, readString, readStringArray, readStringList, readText, readTimeValue, readTimeZone, readVInt, readVIntArray, readVLong, readVLongArray, readZLong, wrap, wrap
-
-
-
-
Constructor Detail
-
NamedWriteableAwareStreamInput
public NamedWriteableAwareStreamInput(StreamInput delegate, NamedWriteableRegistry namedWriteableRegistry)
-
-
Method Detail
-
readNamedWriteable
public <C extends NamedWriteable> C readNamedWriteable(java.lang.Class<C> categoryClass) throws java.io.IOException
Description copied from class:StreamInput
Reads aNamedWriteable
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 throwsUnsupportedOperationException
as StreamInput doesn't hold a registry. UseFilterInputStream
instead which wraps a stream and supports aNamedWriteableRegistry
too.- Overrides:
readNamedWriteable
in classStreamInput
- 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 aNamedWriteable
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 throwsUnsupportedOperationException
as StreamInput doesn't hold a registry. UseFilterInputStream
instead which wraps a stream and supports aNamedWriteableRegistry
too. PreferStreamInput.readNamedWriteable(Class)
andStreamOutput.writeNamedWriteable(NamedWriteable)
unless you have a compelling reason to use this method instead.- Overrides:
readNamedWriteable
in classStreamInput
- Throws:
java.io.IOException
-
-