Search in sources :

Example 1 with ResourceHttpMessageReader

use of cn.taketoday.http.codec.ResourceHttpMessageReader in project today-infrastructure by TAKETODAY.

the class BaseDefaultCodecs method initTypedReaders.

/**
 * Reset and initialize typed readers.
 */
protected void initTypedReaders() {
    this.typedReaders.clear();
    if (!this.registerDefaults) {
        return;
    }
    addCodec(this.typedReaders, new DecoderHttpMessageReader<>(new ByteArrayDecoder()));
    addCodec(this.typedReaders, new DecoderHttpMessageReader<>(new ByteBufferDecoder()));
    addCodec(this.typedReaders, new DecoderHttpMessageReader<>(new DataBufferDecoder()));
    if (nettyByteBufPresent) {
        addCodec(this.typedReaders, new DecoderHttpMessageReader<>(new NettyByteBufDecoder()));
    }
    addCodec(this.typedReaders, new ResourceHttpMessageReader(new ResourceDecoder()));
    addCodec(this.typedReaders, new DecoderHttpMessageReader<>(StringDecoder.textPlainOnly()));
    if (protobufPresent) {
        addCodec(this.typedReaders, new DecoderHttpMessageReader<>(this.protobufDecoder != null ? (ProtobufDecoder) this.protobufDecoder : new ProtobufDecoder()));
    }
    addCodec(this.typedReaders, new FormHttpMessageReader());
    // client vs server..
    extendTypedReaders(this.typedReaders);
}
Also used : FormHttpMessageReader(cn.taketoday.http.codec.FormHttpMessageReader) NettyByteBufDecoder(cn.taketoday.core.codec.NettyByteBufDecoder) AbstractDataBufferDecoder(cn.taketoday.core.codec.AbstractDataBufferDecoder) DataBufferDecoder(cn.taketoday.core.codec.DataBufferDecoder) ProtobufDecoder(cn.taketoday.http.codec.protobuf.ProtobufDecoder) ResourceHttpMessageReader(cn.taketoday.http.codec.ResourceHttpMessageReader) ResourceDecoder(cn.taketoday.core.codec.ResourceDecoder) ByteBufferDecoder(cn.taketoday.core.codec.ByteBufferDecoder) ByteArrayDecoder(cn.taketoday.core.codec.ByteArrayDecoder)

Example 2 with ResourceHttpMessageReader

use of cn.taketoday.http.codec.ResourceHttpMessageReader in project today-framework by TAKETODAY.

the class BaseDefaultCodecs method initTypedReaders.

/**
 * Reset and initialize typed readers.
 */
protected void initTypedReaders() {
    this.typedReaders.clear();
    if (!this.registerDefaults) {
        return;
    }
    addCodec(this.typedReaders, new DecoderHttpMessageReader<>(new ByteArrayDecoder()));
    addCodec(this.typedReaders, new DecoderHttpMessageReader<>(new ByteBufferDecoder()));
    addCodec(this.typedReaders, new DecoderHttpMessageReader<>(new DataBufferDecoder()));
    if (nettyByteBufPresent) {
        addCodec(this.typedReaders, new DecoderHttpMessageReader<>(new NettyByteBufDecoder()));
    }
    addCodec(this.typedReaders, new ResourceHttpMessageReader(new ResourceDecoder()));
    addCodec(this.typedReaders, new DecoderHttpMessageReader<>(StringDecoder.textPlainOnly()));
    if (protobufPresent) {
        addCodec(this.typedReaders, new DecoderHttpMessageReader<>(this.protobufDecoder != null ? (ProtobufDecoder) this.protobufDecoder : new ProtobufDecoder()));
    }
    addCodec(this.typedReaders, new FormHttpMessageReader());
    // client vs server..
    extendTypedReaders(this.typedReaders);
}
Also used : FormHttpMessageReader(cn.taketoday.http.codec.FormHttpMessageReader) NettyByteBufDecoder(cn.taketoday.core.codec.NettyByteBufDecoder) AbstractDataBufferDecoder(cn.taketoday.core.codec.AbstractDataBufferDecoder) DataBufferDecoder(cn.taketoday.core.codec.DataBufferDecoder) ProtobufDecoder(cn.taketoday.http.codec.protobuf.ProtobufDecoder) ResourceHttpMessageReader(cn.taketoday.http.codec.ResourceHttpMessageReader) ResourceDecoder(cn.taketoday.core.codec.ResourceDecoder) ByteBufferDecoder(cn.taketoday.core.codec.ByteBufferDecoder) ByteArrayDecoder(cn.taketoday.core.codec.ByteArrayDecoder)

Aggregations

AbstractDataBufferDecoder (cn.taketoday.core.codec.AbstractDataBufferDecoder)2 ByteArrayDecoder (cn.taketoday.core.codec.ByteArrayDecoder)2 ByteBufferDecoder (cn.taketoday.core.codec.ByteBufferDecoder)2 DataBufferDecoder (cn.taketoday.core.codec.DataBufferDecoder)2 NettyByteBufDecoder (cn.taketoday.core.codec.NettyByteBufDecoder)2 ResourceDecoder (cn.taketoday.core.codec.ResourceDecoder)2 FormHttpMessageReader (cn.taketoday.http.codec.FormHttpMessageReader)2 ResourceHttpMessageReader (cn.taketoday.http.codec.ResourceHttpMessageReader)2 ProtobufDecoder (cn.taketoday.http.codec.protobuf.ProtobufDecoder)2