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:
Closeable
,AutoCloseable
Wraps a
StreamInput
and associates it with a NamedWriteableRegistry
-
Field Summary
Fields inherited from class org.elasticsearch.common.io.stream.FilterStreamInput
delegate
-
Constructor Summary
ConstructorDescriptionNamedWriteableAwareStreamInput(StreamInput delegate, NamedWriteableRegistry namedWriteableRegistry)
-
Method Summary
Modifier and TypeMethodDescriptionGet the registry of named writeables if this stream has one,null
otherwise.<C extends NamedWriteable>
CreadNamedWriteable(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(Class<C> categoryClass, 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, readInt, readLong, readReleasableBytesReference, readShort, readVInt, readVLong, reset, setVersion
Methods inherited from class org.elasticsearch.common.io.stream.StreamInput
readArray, readArraySize, readBigInteger, readBoolean, readByteArray, readBytesRef, readBytesRef, readBytesReference, readBytesReference, readDouble, readDoubleArray, readEnum, readEnumSet, readException, readFloat, readFloatArray, readFully, readGenericValue, readGeoPoint, readImmutableMap, readInstant, readIntArray, readList, readLongArray, readMap, readMap, readMapOfLists, readNamedWriteableList, readOptionalArray, readOptionalBoolean, readOptionalBytesReference, readOptionalDouble, readOptionalEnum, readOptionalFloat, readOptionalInstant, readOptionalInt, readOptionalLong, readOptionalNamedWriteable, readOptionalSecureString, readOptionalString, readOptionalStringArray, readOptionalStringList, readOptionalText, readOptionalTimeValue, readOptionalTimeZone, readOptionalVInt, readOptionalVLong, readOptionalWriteable, readOptionalZoneId, readOrderedMap, readSecureString, readSet, readString, readStringArray, readStringList, readText, readTimeValue, readTimeZone, readVIntArray, readVIntSlow, readVLongArray, readVLongSlow, readZLong, readZoneId, throwOnBrokenVInt, throwOnBrokenVLong, wrap, wrap
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo
-
Constructor Details
-
NamedWriteableAwareStreamInput
public NamedWriteableAwareStreamInput(StreamInput delegate, NamedWriteableRegistry namedWriteableRegistry)
-
-
Method Details
-
readNamedWriteable
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:
IOException
-
readNamedWriteable
public <C extends NamedWriteable> C readNamedWriteable(Class<C> categoryClass, String name) throws IOExceptionDescription 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:
IOException
-
namedWriteableRegistry
Description copied from class:StreamInput
Get the registry of named writeables if this stream has one,null
otherwise.- Overrides:
namedWriteableRegistry
in classFilterStreamInput
-