Example usage for org.springframework.http.converter ByteArrayHttpMessageConverter ByteArrayHttpMessageConverter

List of usage examples for org.springframework.http.converter ByteArrayHttpMessageConverter ByteArrayHttpMessageConverter

Introduction

In this page you can find the example usage for org.springframework.http.converter ByteArrayHttpMessageConverter ByteArrayHttpMessageConverter.

Prototype

public ByteArrayHttpMessageConverter() 

Source Link

Document

Create a new instance of the ByteArrayHttpMessageConverter .

Usage

From source file:org.springframework.http.converter.FormHttpMessageConverter.java

public FormHttpMessageConverter() {
    this.supportedMediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED);
    this.supportedMediaTypes.add(MediaType.MULTIPART_FORM_DATA);

    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false); // see SPR-7316

    this.partConverters.add(new ByteArrayHttpMessageConverter());
    this.partConverters.add(stringHttpMessageConverter);
    this.partConverters.add(new ResourceHttpMessageConverter());

    applyDefaultCharset();//from   w  w w  .j  ava2s.co  m
}

From source file:org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.java

public AnnotationMethodHandlerAdapter() {
    // no restriction of HTTP methods by default
    super(false);

    // See SPR-7316
    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false);
    this.messageConverters = new HttpMessageConverter<?>[] { new ByteArrayHttpMessageConverter(),
            stringHttpMessageConverter, new SourceHttpMessageConverter<Source>(),
            new org.springframework.http.converter.xml.XmlAwareFormHttpMessageConverter() };
}

From source file:org.springframework.web.servlet.mvc.annotation.MyAnnotationMethodHandlerAdapter.java

public MyAnnotationMethodHandlerAdapter() {
    // no restriction of HTTP methods by default
    super(false);

    // See SPR-7316
    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false);
    this.messageConverters = new HttpMessageConverter[] { new ByteArrayHttpMessageConverter(),
            stringHttpMessageConverter, new SourceHttpMessageConverter(),
            new XmlAwareFormHttpMessageConverter() };
}