@Singleton public class TextPlainCodec extends Object implements MediaTypeCodec
MediaType.TEXT_PLAIN.| Modifier and Type | Field and Description | 
|---|---|
static String | 
CONFIGURATION_QUALIFIER  | 
| Constructor and Description | 
|---|
TextPlainCodec(Charset defaultCharset)  | 
TextPlainCodec(Optional<Charset> defaultCharset,
              CodecConfiguration codecConfiguration)  | 
| Modifier and Type | Method and Description | 
|---|---|
<T> T | 
decode(Argument<T> type,
      ByteBuffer<?> buffer)
Decode the given type from the given buffer. 
 | 
<T> T | 
decode(Argument<T> type,
      InputStream inputStream)
Decode the given type from the given  
InputStream. | 
<T> byte[] | 
encode(T object)
Encode the given type returning the object as a byte[]. 
 | 
<T> ByteBuffer | 
encode(T object,
      ByteBufferFactory allocator)
Encode the given type returning the object as a  
ByteBuffer. | 
<T> void | 
encode(T object,
      OutputStream outputStream)
Encode the given type from the given  
InputStream. | 
Collection<MediaType> | 
getMediaTypes()  | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdecode, decode, decode, decode, decode, decode, supportsTypepublic static final String CONFIGURATION_QUALIFIER
@Inject public TextPlainCodec(@Value(value="${micronaut.application.default-charset}") Optional<Charset> defaultCharset, @Named(value="text") @Nullable CodecConfiguration codecConfiguration)
defaultCharset - The default charset used for serialization and deserializationcodecConfiguration - The configuration for the codecpublic TextPlainCodec(Charset defaultCharset)
defaultCharset - The default charset used for serialization and deserializationpublic Collection<MediaType> getMediaTypes()
getMediaTypes in interface MediaTypeCodecpublic <T> T decode(Argument<T> type, ByteBuffer<?> buffer) throws CodecException
MediaTypeCodecByteBuffer instances
 should override this method.decode in interface MediaTypeCodecT - The decoded typetype - The typebuffer - the bufferCodecException - When the result cannot be decodedpublic <T> T decode(Argument<T> type, InputStream inputStream) throws CodecException
MediaTypeCodecInputStream.decode in interface MediaTypeCodecT - The generic typetype - The typeinputStream - The input streamCodecException - When the result cannot be decodedpublic <T> void encode(T object,
                       OutputStream outputStream)
                throws CodecException
MediaTypeCodecInputStream.encode in interface MediaTypeCodecT - The generic typeobject - The object to encodeoutputStream - The input streamCodecException - When the result cannot be decodedpublic <T> byte[] encode(T object)
                  throws CodecException
MediaTypeCodecencode in interface MediaTypeCodecT - The generic typeobject - The object to encodeCodecException - When the result cannot be decodedpublic <T> ByteBuffer encode(T object, ByteBufferFactory allocator) throws CodecException
MediaTypeCodecByteBuffer.encode in interface MediaTypeCodecT - The generic typeobject - The object to encodeallocator - The allocatorCodecException - When the result cannot be decoded