BufferedMediaTypeFormatter Class

 

Represents a helper class to allow a synchronous formatter on top of the asynchronous formatter infrastructure.

Namespace:   System.Net.Http.Formatting
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

Inheritance Hierarchy

System.Object
  System.Net.Http.Formatting.MediaTypeFormatter
    System.Net.Http.Formatting.BufferedMediaTypeFormatter

Syntax

public abstract class BufferedMediaTypeFormatter : MediaTypeFormatter
public ref class BufferedMediaTypeFormatter abstract : MediaTypeFormatter
[<AbstractClass>]
type BufferedMediaTypeFormatter = 
    class
        inherit MediaTypeFormatter
    end
Public MustInherit Class BufferedMediaTypeFormatter
    Inherits MediaTypeFormatter

Constructors

Name Description
System_CAPS_protmethod BufferedMediaTypeFormatter()

Initializes a new instance of the BufferedMediaTypeFormatter class.

System_CAPS_protmethod BufferedMediaTypeFormatter(BufferedMediaTypeFormatter)

Initializes a new instance of the BufferedMediaTypeFormatter class.

Properties

Name Description
System_CAPS_pubproperty BufferSize

Gets or sets the suggested size of buffer to use with streams in bytes.

System_CAPS_pubproperty MediaTypeMappings

Gets the mutable collection of MediaTypeMapping objects that match HTTP requests to media types.(Inherited from MediaTypeFormatter.)

System_CAPS_pubproperty RequiredMemberSelector

Gets or sets the IRequiredMemberSelector instance used to determine required members.(Inherited from MediaTypeFormatter.)

System_CAPS_pubproperty SupportedEncodings

Gets the mutable collection of character encodings supported bythis MediaTypeFormatter.(Inherited from MediaTypeFormatter.)

System_CAPS_pubproperty SupportedMediaTypes

Gets the mutable collection of media types supported bythis MediaTypeFormatter.(Inherited from MediaTypeFormatter.)

Methods

Name Description
System_CAPS_pubmethod CanReadType(Type)

Queries whether this MediaTypeFormatter can deserializean object of the specified type.(Inherited from MediaTypeFormatter.)

System_CAPS_pubmethod CanWriteType(Type)

Queries whether this MediaTypeFormatter can serializean object of the specified type.(Inherited from MediaTypeFormatter.)

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetPerRequestFormatterInstance(Type, HttpRequestMessage, MediaTypeHeaderValue)

Returns a specialized instance of the MediaTypeFormatter that can format a response for the given parameters.(Inherited from MediaTypeFormatter.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ReadFromStream(Type, Stream, HttpContent, IFormatterLogger)

Reads synchronously from the buffered stream.

System_CAPS_pubmethod ReadFromStream(Type, Stream, HttpContent, IFormatterLogger, CancellationToken)

Reads synchronously from the buffered stream.

System_CAPS_pubmethod ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger)

Reads asynchronously from the buffered stream.(Overrides MediaTypeFormatter.ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger).)

System_CAPS_pubmethod ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger, CancellationToken)

Reads asynchronously from the buffered stream.(Overrides MediaTypeFormatter.ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger, CancellationToken).)

System_CAPS_pubmethod SelectCharacterEncoding(HttpContentHeaders)

Determines the best character encoding for reading or writing an HTTP entity body, given a set of content headers.(Inherited from MediaTypeFormatter.)

System_CAPS_pubmethod SetDefaultContentHeaders(Type, HttpContentHeaders, MediaTypeHeaderValue)

Sets the default headers for content that will be formatted using this formatter. This method is called from the ObjectContent constructor. This implementation sets the Content-Type header to the value of mediaType if it is not null. If it is null it sets the Content-Type to the default media type of this formatter. If the Content-Type does not specify a charset it will set it using this formatters configured Encoding. (Inherited from MediaTypeFormatter.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_pubmethod WriteToStream(Type, Object, Stream, HttpContent)

Writes synchronously to the buffered stream.

System_CAPS_pubmethod WriteToStream(Type, Object, Stream, HttpContent, CancellationToken)

Writes synchronously to the buffered stream.

System_CAPS_pubmethod WriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext)

Writes asynchronously to the buffered stream.(Overrides MediaTypeFormatter.WriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext).)

System_CAPS_pubmethod WriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext, CancellationToken)

Writes asynchronously to the buffered stream.(Overrides MediaTypeFormatter.WriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext, CancellationToken).)

Extension Methods

Name Description
System_CAPS_pubmethod AddQueryStringMapping(String, String, MediaTypeHeaderValue)

Overloaded. (Defined by MediaTypeFormatterExtensions.)

System_CAPS_pubmethod AddQueryStringMapping(String, String, String)

Overloaded. (Defined by MediaTypeFormatterExtensions.)

System_CAPS_pubmethod AddRequestHeaderMapping(String, String, StringComparison, Boolean, MediaTypeHeaderValue)

Overloaded. (Defined by MediaTypeFormatterExtensions.)

System_CAPS_pubmethod AddRequestHeaderMapping(String, String, StringComparison, Boolean, String)

Overloaded. (Defined by MediaTypeFormatterExtensions.)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

System.Net.Http.Formatting Namespace

Return to top