Package io.micronaut.http.server.codec
Class TextStreamCodec
java.lang.Object
io.micronaut.http.server.codec.TextStreamCodec
- All Implemented Interfaces:
io.micronaut.http.codec.MediaTypeCodec
@Singleton
@Internal
@Requires(bean=io.micronaut.core.io.buffer.ByteBufferFactory.class)
@Deprecated(forRemoval=true,
since="4.7")
public class TextStreamCodec
extends Object
implements io.micronaut.http.codec.MediaTypeCodec
Deprecated, for removal: This API element is subject to removal in a future version.
Replaced with message body writers / readers API
A
MediaTypeCodec that will encode Event objects in order to support Server Sent Events.- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
ConstructorsModifierConstructorDescriptionTextStreamCodec(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration, io.micronaut.core.io.buffer.ByteBufferFactory byteBufferFactory, io.micronaut.context.BeanProvider<io.micronaut.http.codec.MediaTypeCodecRegistry> codecRegistryProvider, @Nullable io.micronaut.http.codec.CodecConfiguration codecConfiguration) Deprecated, for removal: This API element is subject to removal in a future version.protectedTextStreamCodec(Charset defaultCharset, io.micronaut.core.io.buffer.ByteBufferFactory byteBufferFactory, io.micronaut.context.BeanProvider<io.micronaut.http.codec.MediaTypeCodecRegistry> codecRegistryProvider, @Nullable io.micronaut.http.codec.CodecConfiguration codecConfiguration) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescription<T> Tdecode(io.micronaut.core.type.Argument<T> type, InputStream inputStream) Deprecated, for removal: This API element is subject to removal in a future version.<T> Tdecode(Class<T> type, InputStream inputStream) Deprecated, for removal: This API element is subject to removal in a future version.<T> byte[]encode(T object) Deprecated, for removal: This API element is subject to removal in a future version.<T,B> io.micronaut.core.io.buffer.ByteBuffer<B> encode(T object, io.micronaut.core.io.buffer.ByteBufferFactory<?, B> allocator) Deprecated, for removal: This API element is subject to removal in a future version.<T> voidencode(T object, OutputStream outputStream) Deprecated, for removal: This API element is subject to removal in a future version.Collection<io.micronaut.http.MediaType>Deprecated, for removal: This API element is subject to removal in a future version.protected voidwriteAttribute(io.micronaut.core.io.buffer.ByteBuffer eventData, byte[] attribute, String value) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.http.codec.MediaTypeCodec
decode, decode, decode, decode, decode, decode, encode, encode, encode, supportsType
-
Field Details
-
CONFIGURATION_QUALIFIER
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
-
Constructor Details
-
TextStreamCodec
@Inject public TextStreamCodec(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration, io.micronaut.core.io.buffer.ByteBufferFactory byteBufferFactory, io.micronaut.context.BeanProvider<io.micronaut.http.codec.MediaTypeCodecRegistry> codecRegistryProvider, @Named("text-stream") @Nullable @Nullable io.micronaut.http.codec.CodecConfiguration codecConfiguration) Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
applicationConfiguration- The application configurationbyteBufferFactory- A byte buffer factorycodecRegistryProvider- A media type codec registrycodecConfiguration- The configuration for the codec
-
TextStreamCodec
protected TextStreamCodec(Charset defaultCharset, io.micronaut.core.io.buffer.ByteBufferFactory byteBufferFactory, io.micronaut.context.BeanProvider<io.micronaut.http.codec.MediaTypeCodecRegistry> codecRegistryProvider, @Named("text-stream") @Nullable @Nullable io.micronaut.http.codec.CodecConfiguration codecConfiguration) Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
defaultCharset- The default charsetbyteBufferFactory- A byte buffer factorycodecRegistryProvider- A media type codec registrycodecConfiguration- The configuration for the codec
-
-
Method Details
-
getMediaTypes
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getMediaTypesin interfaceio.micronaut.http.codec.MediaTypeCodec
-
decode
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
decodein interfaceio.micronaut.http.codec.MediaTypeCodec
-
decode
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
decodein interfaceio.micronaut.http.codec.MediaTypeCodec
-
encode
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
encodein interfaceio.micronaut.http.codec.MediaTypeCodec
-
encode
public <T> byte[] encode(T object) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
encodein interfaceio.micronaut.http.codec.MediaTypeCodec
-
encode
public <T,B> io.micronaut.core.io.buffer.ByteBuffer<B> encode(T object, io.micronaut.core.io.buffer.ByteBufferFactory<?, B> allocator) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
encodein interfaceio.micronaut.http.codec.MediaTypeCodec
-
writeAttribute
protected void writeAttribute(io.micronaut.core.io.buffer.ByteBuffer eventData, byte[] attribute, String value) Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
eventData- The byte bufferattribute- The attributevalue- The value
-