Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Net.Http.Json.JsonContent< TValue > Class Template Referencesealed

Public Member Functions

 JsonContent (TValue inputValue, JsonTypeInfo< TValue > jsonTypeInfo)
 
Task< stringReadAsStringAsync ()
 
Task< stringReadAsStringAsync (CancellationToken cancellationToken)
 
Task< byte[]> ReadAsByteArrayAsync ()
 
Task< byte[]> ReadAsByteArrayAsync (CancellationToken cancellationToken)
 
Stream ReadAsStream ()
 
Stream ReadAsStream (CancellationToken cancellationToken)
 
Task< StreamReadAsStreamAsync ()
 
Task< StreamReadAsStreamAsync (CancellationToken cancellationToken)
 
void CopyTo (Stream stream, TransportContext? context, CancellationToken cancellationToken)
 
Task CopyToAsync (Stream stream)
 
Task CopyToAsync (Stream stream, CancellationToken cancellationToken)
 
Task CopyToAsync (Stream stream, TransportContext? context)
 
Task CopyToAsync (Stream stream, TransportContext? context, CancellationToken cancellationToken)
 
Task LoadIntoBufferAsync ()
 
Task LoadIntoBufferAsync (long maxBufferSize)
 
void Dispose ()
 

Static Public Member Functions

static JsonContent Create< T > (T inputValue, MediaTypeHeaderValue? mediaType=null, JsonSerializerOptions? options=null)
 
static JsonContent Create (object? inputValue, Type inputType, MediaTypeHeaderValue? mediaType=null, JsonSerializerOptions? options=null)
 

Protected Member Functions

override Task SerializeToStreamAsync (Stream stream, TransportContext? context)
 
override bool TryComputeLength (out long length)
 
override void SerializeToStream (Stream stream, TransportContext? context, CancellationToken cancellationToken)
 
override Task SerializeToStreamAsync (Stream stream, TransportContext? context, CancellationToken cancellationToken)
 
override Task SerializeToStreamAsync (Stream stream, TransportContext context)
 
override bool TryComputeLength (out long length)
 
override void SerializeToStream (Stream stream, TransportContext context, CancellationToken cancellationToken)
 
override Task SerializeToStreamAsync (Stream stream, TransportContext context, CancellationToken cancellationToken)
 
virtual Stream CreateContentReadStream (CancellationToken cancellationToken)
 
virtual Task< StreamCreateContentReadStreamAsync ()
 
virtual Task< StreamCreateContentReadStreamAsync (CancellationToken cancellationToken)
 
virtual void Dispose (bool disposing)
 

Package Functions

bool TryGetBuffer (out ArraySegment< byte > buffer)
 
byte[] ReadBufferedContentAsByteArray ()
 
Stream TryReadAsStream ()
 
ValueTask InternalCopyToAsync (Stream stream, TransportContext context, CancellationToken cancellationToken)
 
void LoadIntoBuffer (long maxBufferSize, CancellationToken cancellationToken)
 
Task LoadIntoBufferAsync (CancellationToken cancellationToken)
 
Task LoadIntoBufferAsync (long maxBufferSize, CancellationToken cancellationToken)
 
virtual Stream TryCreateContentReadStream ()
 
long? GetComputedOrBufferLength ()
 

Static Package Functions

static string ReadBufferAsString (ArraySegment< byte > buffer, HttpContentHeaders headers)
 
static bool StreamCopyExceptionNeedsWrapping (Exception e)
 
static Exception WrapStreamCopyException (Exception e)
 

Static Package Attributes

static readonly Encoding DefaultStringEncoding = Encoding.UTF8
 

Properties

Type ObjectType [get]
 
object? Value [get]
 
HttpContentHeaders Headers [get]
 
bool IsBuffered [get]
 
virtual bool AllowDuplex [get]
 

Private Member Functions

 JsonContent (object inputValue, Type inputType, MediaTypeHeaderValue mediaType, JsonSerializerOptions options)
 
async Task SerializeToStreamAsyncCore (Stream targetStream, bool async, CancellationToken cancellationToken)
 
async Task SerializeToStreamAsyncCore (Stream targetStream, bool async, CancellationToken cancellationToken)
 
string ReadBufferedContentAsString ()
 
async Task LoadIntoBufferAsyncCore (Task serializeToStreamTask, MemoryStream tempBuffer)
 
bool CreateTemporaryBuffer (long maxBufferSize, out MemoryStream tempBuffer, out Exception error)
 
MemoryStream CreateMemoryStream (long maxBufferSize, out Exception error)
 
void CheckDisposed ()
 
void CheckTaskNotNull (Task task)
 

Static Private Member Functions

static Exception GetStreamCopyException (Exception originalException)
 
static int GetPreambleLength (ArraySegment< byte > buffer, Encoding encoding)
 
static bool TryDetectEncoding (ArraySegment< byte > buffer, [NotNullWhen(true)] out Encoding encoding, out int preambleLength)
 
static bool BufferHasPrefix (ArraySegment< byte > buffer, byte[] prefix)
 
static async Task< TResultWaitAndReturnAsync< TState, TResult > (Task waitTask, TState state, Func< TState, TResult > returnFunc)
 
static Exception CreateOverCapacityException (int maxBufferSize)
 

Private Attributes

readonly JsonSerializerOptions _jsonSerializerOptions
 
readonly JsonTypeInfo< TValue > _typeInfo
 
readonly TValue _typedValue
 
HttpContentHeaders _headers
 
MemoryStream _bufferedContent
 
object _contentReadStream
 
bool _disposed
 
bool _canCalculateLength
 

Detailed Description

Definition at line 120 of file JsonContent.cs.


The documentation for this class was generated from the following file: