26 instantiations of BinaryData
AzureContainerApps.ApiService (1)
AzureFunctionsEndToEnd.ApiService (2)
AzureStorageEndToEnd.ApiService (1)
BicepSample.ApiService (3)
CdkSample.ApiService (1)
Microsoft.Extensions.AI.AzureAIInference (3)
Microsoft.Extensions.AI.OpenAI (2)
System.Memory.Data (13)
System\BinaryData.cs (13)
35public static BinaryData Empty { get; } = new BinaryData(ReadOnlyMemory<byte>.Empty);
169public static BinaryData FromBytes(ReadOnlyMemory<byte> data) => new BinaryData(data);
181=> new BinaryData(data, mediaType);
189public static BinaryData FromBytes(byte[] data) => new BinaryData(data);
200=> new BinaryData(data, mediaType);
208public static BinaryData FromString(string data) => new BinaryData(data);
220=> new BinaryData(data, mediaType);
314return new BinaryData(memoryStream.GetBuffer().AsMemory(0, (int)memoryStream.Position), mediaType);
340return new BinaryData(File.ReadAllBytes(path), mediaType);
374return new BinaryData(
397=> new BinaryData(JsonSerializer.SerializeToUtf8Bytes(jsonSerializable, options), MediaTypeApplicationJson);
410=> new BinaryData(JsonSerializer.SerializeToUtf8Bytes(jsonSerializable, jsonTypeInfo), MediaTypeApplicationJson);
419=> new BinaryData(_bytes, mediaType);
78 references to BinaryData
Aspire.Hosting.Azure (2)
Aspire.Hosting.Azure.Tests (1)
AzureFunctionsEndToEnd.ApiService (1)
EventHubsApi (4)
Microsoft.Extensions.AI.AzureAIInference (5)
Microsoft.Extensions.AI.OpenAI (6)
System.Memory.Data (59)
System\BinaryData.cs (54)
28/// The backing store for the <see cref="BinaryData"/> instance.
35public static BinaryData Empty { get; } = new BinaryData(ReadOnlyMemory<byte>.Empty);
56/// Creates a <see cref="BinaryData"/> instance by wrapping the
66/// Creates a <see cref="BinaryData"/> instance by wrapping the provided byte array
78/// Creates a <see cref="BinaryData"/> instance by serializing the provided object to JSON
97/// Creates a <see cref="BinaryData"/> instance by serializing the provided object to JSON
114/// Creates a <see cref="BinaryData"/> instance by wrapping the
124/// Creates a <see cref="BinaryData"/> instance by wrapping the provided bytes
136/// Creates a <see cref="BinaryData"/> instance from a string by converting
151/// Creates a <see cref="BinaryData"/> instance from a string by converting
164/// Creates a <see cref="BinaryData"/> instance by wrapping the provided
169public static BinaryData FromBytes(ReadOnlyMemory<byte> data) => new BinaryData(data);
172/// Creates a <see cref="BinaryData"/> instance by wrapping the provided
180public static BinaryData FromBytes(ReadOnlyMemory<byte> data, string? mediaType)
184/// Creates a <see cref="BinaryData"/> instance by wrapping the provided
189public static BinaryData FromBytes(byte[] data) => new BinaryData(data);
192/// Creates a <see cref="BinaryData"/> instance by wrapping the provided byte array
199public static BinaryData FromBytes(byte[] data, string? mediaType)
203/// Creates a <see cref="BinaryData"/> instance from a string by converting
208public static BinaryData FromString(string data) => new BinaryData(data);
211/// Creates a <see cref="BinaryData"/> instance from a string by converting
219public static BinaryData FromString(string data, string? mediaType)
223/// Creates a <see cref="BinaryData"/> instance from the specified stream.
228public static BinaryData FromStream(Stream stream) => FromStream(stream, mediaType: null);
231/// Creates a <see cref="BinaryData"/> instance from the specified stream
239public static BinaryData FromStream(Stream stream, string? mediaType)
250/// Creates a <see cref="BinaryData"/> instance from the specified stream.
256public static Task<BinaryData> FromStreamAsync(Stream stream, CancellationToken cancellationToken = default)
260/// Creates a <see cref="BinaryData"/> instance from the specified stream
269public static Task<BinaryData> FromStreamAsync(Stream stream, string? mediaType,
280private static async Task<BinaryData> FromStreamAsync(Stream stream, bool useAsync,
319/// Creates a <see cref="BinaryData"/> instance from the specified file.
323public static BinaryData FromFile(string path) => FromFile(path, mediaType: null);
326/// Creates a <see cref="BinaryData"/> instance from the specified file
333public static BinaryData FromFile(string path, string? mediaType)
344/// Creates a <see cref="BinaryData"/> instance from the specified file.
349public static Task<BinaryData> FromFileAsync(string path, CancellationToken cancellationToken = default)
353/// Creates a <see cref="BinaryData"/> instance from the specified file
361public static Task<BinaryData> FromFileAsync(string path, string? mediaType,
371async Task<BinaryData> Core()
385/// Creates a <see cref="BinaryData"/> instance by serializing the provided object using
396public static BinaryData FromObjectAsJson<T>(T jsonSerializable, JsonSerializerOptions? options = default)
400/// Creates a <see cref="BinaryData"/> instance by serializing the provided object using
409public static BinaryData FromObjectAsJson<T>(T jsonSerializable, JsonTypeInfo<T> jsonTypeInfo)
413/// Creates a <see cref="BinaryData"/> instance by wrapping the same data
418public BinaryData WithMediaType(string? mediaType)
450/// Converts the <see cref="BinaryData"/> to a read-only stream.
462/// Converts the <see cref="BinaryData"/> to a byte array.
468/// Converts the <see cref="BinaryData"/> to the specified type using
481/// Converts the <see cref="BinaryData"/> to the specified type using
503/// Defines an implicit conversion from a <see cref="BinaryData" /> to a <see cref="ReadOnlyMemory{Byte}"/>.
506public static implicit operator ReadOnlyMemory<byte>(BinaryData? data) => data?._bytes ?? default;
509/// Defines an implicit conversion from a <see cref="BinaryData" /> to a <see cref="ReadOnlySpan{Byte}"/>.
512public static implicit operator ReadOnlySpan<byte>(BinaryData? data)