Bagikan melalui


Buffer Kelas

Definisi

Menyediakan implementasi default antarmuka IBuffer dan antarmuka terkait.

public ref class Buffer sealed : IBuffer
/// [Windows.Foundation.Metadata.Activatable(Windows.Storage.Streams.IBufferFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class Buffer final : IBuffer
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Storage.Streams.IBufferFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class Buffer final : IBuffer
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Storage.Streams.IBufferFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class Buffer : IBuffer
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Storage.Streams.IBufferFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class Buffer : IBuffer
function Buffer(capacity)
Public NotInheritable Class Buffer
Implements IBuffer
Warisan
Object Platform::Object IInspectable Buffer
Atribut
Penerapan

Persyaratan Windows

Rangkaian perangkat
Windows 10 (diperkenalkan dalam 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (diperkenalkan dalam v1.0)

Keterangan

Untuk informasi selengkapnya, lihat Membuat, menulis, dan membaca file, yang menunjukkan cara membaca dan menulis byte ke file dengan menggunakan Buffer.

Konstruktor

Buffer(UInt32)

Menginisialisasi instans baru kelas Buffer dengan kapasitas yang ditentukan.

Properti

Capacity

Mendapatkan jumlah maksimum byte yang dapat ditahan oleh buffer.

Length

Mendapatkan jumlah byte yang saat ini digunakan dalam buffer.

Metode

CreateCopyFromMemoryBuffer(IMemoryBuffer)

Membuat buffer baru yang berisi salinan buffer tertentu.

CreateMemoryBufferOverIBuffer(IBuffer)

Membuat MemoryBuffer dari IBuffer yang ada.

Berlaku untuk

Lihat juga