PDFsharp-net6

RawEncoding

Namespace: PdfSharp.Pdf.Internal

An encoder for raw strings. The raw encoding is simply the identity relation between characters and bytes. PDFsharp internally works with raw encoded strings instead of byte arrays because strings are much more handy than byte arrays.

public sealed class RawEncoding : System.Text.Encoding, System.ICloneable

Inheritance ObjectEncodingRawEncoding
Implements ICloneable

Remarks:

Raw encoded strings represent an array of bytes. Therefore a character greater than 255 is not valid in a raw encoded string.

Properties

Preamble

public ReadOnlySpan<byte> Preamble { get; }

Property Value

ReadOnlySpan<Byte>

BodyName

public string BodyName { get; }

Property Value

String

EncodingName

public string EncodingName { get; }

Property Value

String

HeaderName

public string HeaderName { get; }

Property Value

String

WebName

public string WebName { get; }

Property Value

String

WindowsCodePage

public int WindowsCodePage { get; }

Property Value

Int32

IsBrowserDisplay

public bool IsBrowserDisplay { get; }

Property Value

Boolean

IsBrowserSave

public bool IsBrowserSave { get; }

Property Value

Boolean

IsMailNewsDisplay

public bool IsMailNewsDisplay { get; }

Property Value

Boolean

IsMailNewsSave

public bool IsMailNewsSave { get; }

Property Value

Boolean

IsSingleByte

public bool IsSingleByte { get; }

Property Value

Boolean

EncoderFallback

public EncoderFallback EncoderFallback { get; set; }

Property Value

EncoderFallback

DecoderFallback

public DecoderFallback DecoderFallback { get; set; }

Property Value

DecoderFallback

IsReadOnly

public bool IsReadOnly { get;  set; }

Property Value

Boolean

CodePage

public int CodePage { get; }

Property Value

Int32

Constructors

RawEncoding()

Initializes a new instance of the RawEncoding class.

public RawEncoding()

Methods

GetByteCount(Char[], Int32, Int32)

When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters from the specified character array.

public int GetByteCount(Char[] chars, int index, int count)

Parameters

chars Char[]
The character array containing the set of characters to encode.

index Int32
The index of the first character to encode.

count Int32
The number of characters to encode.

Returns

Int32
The number of bytes produced by encoding the specified characters.

GetBytes(Char[], Int32, Int32, Byte[], Int32)

When overridden in a derived class, encodes a set of characters from the specified character array into the specified byte array.

public int GetBytes(Char[] chars, int charIndex, int charCount, Byte[] bytes, int byteIndex)

Parameters

chars Char[]
The character array containing the set of characters to encode.

charIndex Int32
The index of the first character to encode.

charCount Int32
The number of characters to encode.

bytes Byte[]
The byte array to contain the resulting sequence of bytes.

byteIndex Int32
The index at which to start writing the resulting sequence of bytes.

Returns

Int32
The actual number of bytes written into .

GetCharCount(Byte[], Int32, Int32)

When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.

public int GetCharCount(Byte[] bytes, int index, int count)

Parameters

bytes Byte[]
The byte array containing the sequence of bytes to decode.

index Int32
The index of the first byte to decode.

count Int32
The number of bytes to decode.

Returns

Int32
The number of characters produced by decoding the specified sequence of bytes.

GetChars(Byte[], Int32, Int32, Char[], Int32)

When overridden in a derived class, decodes a sequence of bytes from the specified byte array into the specified character array.

public int GetChars(Byte[] bytes, int byteIndex, int byteCount, Char[] chars, int charIndex)

Parameters

bytes Byte[]
The byte array containing the sequence of bytes to decode.

byteIndex Int32
The index of the first byte to decode.

byteCount Int32
The number of bytes to decode.

chars Char[]
The character array to contain the resulting set of characters.

charIndex Int32
The index at which to start writing the resulting set of characters.

Returns

Int32
The actual number of characters written into .

GetMaxByteCount(Int32)

When overridden in a derived class, calculates the maximum number of bytes produced by encoding the specified number of characters.

public int GetMaxByteCount(int charCount)

Parameters

charCount Int32
The number of characters to encode.

Returns

Int32
The maximum number of bytes produced by encoding the specified number of characters.

GetMaxCharCount(Int32)

When overridden in a derived class, calculates the maximum number of characters produced by decoding the specified number of bytes.

public int GetMaxCharCount(int byteCount)

Parameters

byteCount Int32
The number of bytes to decode.

Returns

Int32
The maximum number of characters produced by decoding the specified number of bytes.