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 Object → Encoding → RawEncoding
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.
public ReadOnlySpan<byte> Preamble { get; }
public string BodyName { get; }
public string EncodingName { get; }
public string HeaderName { get; }
public string WebName { get; }
public int WindowsCodePage { get; }
public bool IsBrowserDisplay { get; }
public bool IsBrowserSave { get; }
public bool IsMailNewsDisplay { get; }
public bool IsMailNewsSave { get; }
public bool IsSingleByte { get; }
public EncoderFallback EncoderFallback { get; set; }
public DecoderFallback DecoderFallback { get; set; }
public bool IsReadOnly { get; set; }
public int CodePage { get; }
Initializes a new instance of the RawEncoding class.
public RawEncoding()
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)
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.
Int32
The number of bytes produced by encoding the specified characters.
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)
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.
Int32
The actual number of bytes written into .
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)
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.
Int32
The number of characters produced by decoding the specified sequence of bytes.
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)
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.
Int32
The actual number of characters written into .
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)
charCount
Int32
The number of characters to encode.
Int32
The maximum number of bytes produced by encoding the specified number of characters.
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)
byteCount
Int32
The number of bytes to decode.
Int32
The maximum number of characters produced by decoding the specified number of bytes.