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
ConstructorsConstructorDescriptionNamedWriteableAwareStreamInput(StreamInput delegate, NamedWriteableRegistry namedWriteableRegistry) -
Method Summary
Modifier and TypeMethodDescriptionGet the registry of named writeables if this stream has one,nullotherwise.<C extends NamedWriteable>
CreadNamedWriteable(Class<C> categoryClass)Reads aNamedWriteablefrom 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 aNamedWriteablefrom 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, setVersionMethods 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, wrapMethods 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:StreamInputReads aNamedWriteablefrom 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 throwsUnsupportedOperationExceptionas StreamInput doesn't hold a registry. UseFilterInputStreaminstead which wraps a stream and supports aNamedWriteableRegistrytoo.- Overrides:
readNamedWriteablein classStreamInput- Throws:
IOException
-
readNamedWriteable
public <C extends NamedWriteable> C readNamedWriteable(Class<C> categoryClass, String name) throws IOExceptionDescription copied from class:StreamInputReads aNamedWriteablefrom 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 throwsUnsupportedOperationExceptionas StreamInput doesn't hold a registry. UseFilterInputStreaminstead which wraps a stream and supports aNamedWriteableRegistrytoo. PreferStreamInput.readNamedWriteable(Class)andStreamOutput.writeNamedWriteable(NamedWriteable)unless you have a compelling reason to use this method instead.- Overrides:
readNamedWriteablein classStreamInput- Throws:
IOException
-
namedWriteableRegistry
Description copied from class:StreamInputGet the registry of named writeables if this stream has one,nullotherwise.- Overrides:
namedWriteableRegistryin classFilterStreamInput
-