Buffer Buffer Buffer Buffer Class
Definition
public : sealed class Buffer : IBufferpublic sealed class Buffer : IBufferPublic NotInheritable Class Buffer Implements IBuffer// You can use this class in JavaScript.
- Attributes
Windows 10 requirements
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
For more info, see Quickstart: Reading and writing a file, which shows how to read and write bytes to a file by using a Buffer.
Constructors
Buffer(UInt32) Buffer(UInt32) Buffer(UInt32) Buffer(UInt32)
Initializes a new instance of the Buffer class with the specified capacity.
public : Buffer(unsigned int capacity)public Buffer(UInt32 capacity)Public Sub New(capacity As UInt32)// You can use this method in JavaScript.
Parameters
- capacity
- unsigned int UInt32 UInt32 UInt32
The maximum number of bytes that the buffer can hold.
Properties
Capacity Capacity Capacity Capacity
Gets the maximum number of bytes that the buffer can hold.
public : unsigned int Capacity { get; }public uint Capacity { get; }Public ReadOnly Property Capacity As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The maximum number of bytes that the buffer can hold.
Length Length Length Length
Gets the number of bytes currently in use in the buffer.
public : unsigned int Length { get; set; }public uint Length { get; set; }Public ReadWrite Property Length As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The number of bytes currently in use in the buffer, which is less than or equal to the capacity of the buffer.
Methods
CreateCopyFromMemoryBuffer(IMemoryBuffer) CreateCopyFromMemoryBuffer(IMemoryBuffer) CreateCopyFromMemoryBuffer(IMemoryBuffer) CreateCopyFromMemoryBuffer(IMemoryBuffer)
Creates a new buffer containing a copy of a specified buffer.
public : static Buffer CreateCopyFromMemoryBuffer(IMemoryBuffer input)public static Buffer CreateCopyFromMemoryBuffer(IMemoryBuffer input)Public Static Function CreateCopyFromMemoryBuffer(input As IMemoryBuffer) As Buffer// You can use this method in JavaScript.
Parameters
The buffer to be copied.
Returns
CreateMemoryBufferOverIBuffer(IBuffer) CreateMemoryBufferOverIBuffer(IBuffer) CreateMemoryBufferOverIBuffer(IBuffer) CreateMemoryBufferOverIBuffer(IBuffer)
Creates a MemoryBuffer from an existing IBuffer.
public : static MemoryBuffer CreateMemoryBufferOverIBuffer(IBuffer input)public static MemoryBuffer CreateMemoryBufferOverIBuffer(IBuffer input)Public Static Function CreateMemoryBufferOverIBuffer(input As IBuffer) As MemoryBuffer// You can use this method in JavaScript.
Parameters
Returns
The newly created MemoryBuffer.