<PackageReference Include="System.Reflection.Metadata" Version="11.0.0-preview.7.26381.103" />

System.Reflection.Metadata.BlobBuilder

public class BlobBuilder

public int Count { get; }

protected int FreeBytes { get; }

public BlobBuilder(int capacity = 256)

public void Align(int alignment)

protected virtual BlobBuilder AllocateChunk(int minimalSize)

public void Clear()

public bool ContentEquals(BlobBuilder other)

Compares the current content of this writer with another one.

protected void Free()

protected virtual void FreeChunk()

public Blobs GetBlobs()

Returns a sequence of all blobs that represent the content of the builder.

public void LinkPrefix(BlobBuilder prefix)

public void LinkSuffix(BlobBuilder suffix)

public void PadTo(int position)

public Blob ReserveBytes(int byteCount)

Reserves a contiguous block of bytes.

public byte[] ToArray()

public byte[] ToArray(int start, int byteCount)

public ImmutableArray<byte> ToImmutableArray(int start, int byteCount)

public int TryWriteBytes(Stream source, int byteCount)

Attempts to write a sequence of bytes to the builder. A return value indicates the number of bytes successfully written.

public void WriteBoolean(bool value)

Writes a Boolean value to the builder.

public void WriteByte(byte value)

Writes a Byte value to the builder.

public void WriteBytes(byte value, int byteCount)

Writes a specified number of occurrences of a byte value to the builder.

public void WriteBytes(Byte* buffer, int byteCount)

Writes a specified number of bytes from a buffer to the builder.

public void WriteBytes(ImmutableArray<byte> buffer)

Writes the contents of an immutable byte array to the builder.

public void WriteBytes(ImmutableArray<byte> buffer, int start, int byteCount)

Writes a specified number of bytes starting at a specified index of an immutable array to the builder.

public void WriteBytes(byte[] buffer)

Writes the contents of a byte array to the builder.

public void WriteBytes(byte[] buffer, int start, int byteCount)

Writes a specified number of bytes starting at a specified index in a byte array to the builder.

public void WriteCompressedInteger(int value)

Implements compressed unsigned integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.

public void WriteCompressedSignedInteger(int value)

Implements compressed signed integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.

public void WriteConstant(object value)

Writes a constant value (see ECMA-335 Partition II section 22.9) at the current position.

public void WriteContentTo(Stream destination)

public void WriteContentTo(ref BlobWriter destination)

public void WriteContentTo(BlobBuilder destination)

public void WriteDateTime(DateTime value)

public void WriteDecimal(decimal value)

public void WriteDouble(double value)

public void WriteGuid(Guid value)

public void WriteInt16(short value)

public void WriteInt16BE(short value)

public void WriteInt32(int value)

public void WriteInt32BE(int value)

public void WriteInt64(long value)

public void WriteReference(int reference, bool isSmall)

Writes a reference to a heap (heap offset) or a table (row number).

public void WriteSByte(sbyte value)

public void WriteSerializedString(string value)

Writes a string in SerString format (see ECMA-335-II 23.3 Custom attributes).

public void WriteSingle(float value)

public void WriteUInt16(ushort value)

public void WriteUInt16BE(ushort value)

public void WriteUInt32(uint value)

public void WriteUInt32BE(uint value)

public void WriteUInt64(ulong value)

public void WriteUserString(string value)

Writes a string in User String (#US) heap format (see ECMA-335-II 24.2.4 #US and #Blob heaps).

public void WriteUTF16(char[] value)

Writes a UTF16 (little-endian) encoded character array at the current position.

public void WriteUTF16(string value)

Writes UTF16 (little-endian) encoded string at the current position.

public void WriteUTF8(string value, bool allowUnpairedSurrogates = true)

Writes a UTF8 encoded string at the current position.