mirror of
https://github.com/claunia/Claunia.Encoding.git
synced 2025-12-16 11:14:41 +00:00
General reformat.
This commit is contained in:
@@ -34,29 +34,29 @@ namespace Claunia.Encoding.Tests
|
||||
const string Punctuations = "!\"#$%&'()*+,-./:;<=>?@[\\]^_|";
|
||||
readonly byte[] PunctuationsBytes =
|
||||
{
|
||||
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x3A, 0x3B, 0x3C,
|
||||
0x3D, 0x3E, 0x3F, 0x40, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x7C
|
||||
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x3A, 0x3B,
|
||||
0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x7C
|
||||
};
|
||||
const string Digits = "0123456789";
|
||||
readonly byte[] DigitsBytes = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39};
|
||||
const string UpperLatin = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
readonly byte[] UpperLatinBytes =
|
||||
{
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52,
|
||||
0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51,
|
||||
0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A
|
||||
};
|
||||
const string LowerLatin = "abcdefghijklmnopqrstuvwxyz";
|
||||
readonly byte[] LowerLatinBytes =
|
||||
{
|
||||
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72,
|
||||
0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A
|
||||
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71,
|
||||
0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A
|
||||
};
|
||||
|
||||
const string Graphics = "├┘┤┐╱╲◢▗◣▝▘▂▖┌─┼●▄▎┬┴▌└";
|
||||
readonly byte[] GraphicsBytes =
|
||||
{
|
||||
0x01, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0E, 0x0F, 0x11, 0x12, 0x13, 0x14, 0x15,
|
||||
0x16, 0x17, 0x18, 0x19, 0x1A
|
||||
0x01, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0E, 0x0F, 0x11, 0x12, 0x13, 0x14,
|
||||
0x15, 0x16, 0x17, 0x18, 0x19, 0x1A
|
||||
};
|
||||
const string Arrows = "↑↓←→↰◀▶";
|
||||
readonly byte[] ArrowsBytes = {0x1C, 0x1D, 0x1E, 0x1F, 0x7D, 0x7E, 0x7F};
|
||||
|
||||
@@ -34,22 +34,22 @@ namespace Claunia.Encoding.Tests
|
||||
const string Punctuations = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
|
||||
readonly byte[] PunctuationsBytes =
|
||||
{
|
||||
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x3A, 0x3B, 0x3C,
|
||||
0x3D, 0x3E, 0x3F, 0x40, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x7B, 0x7C, 0x7D, 0x7E
|
||||
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x3A, 0x3B,
|
||||
0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x7B, 0x7C, 0x7D, 0x7E
|
||||
};
|
||||
const string Digits = "0123456789";
|
||||
readonly byte[] DigitsBytes = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39};
|
||||
const string UpperLatin = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
readonly byte[] UpperLatinBytes =
|
||||
{
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52,
|
||||
0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51,
|
||||
0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A
|
||||
};
|
||||
const string LowerLatin = "abcdefghijklmnopqrstuvwxyz";
|
||||
readonly byte[] LowerLatinBytes =
|
||||
{
|
||||
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72,
|
||||
0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A
|
||||
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71,
|
||||
0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A
|
||||
};
|
||||
|
||||
const string Spanish = "¡¿áéíóúüñÉÜÑ";
|
||||
@@ -57,8 +57,8 @@ namespace Claunia.Encoding.Tests
|
||||
const string French = "éÉàèùÀâêîôûëïüÿçÇœŒæÆ";
|
||||
readonly byte[] FrenchBytes =
|
||||
{
|
||||
0x82, 0x90, 0x85, 0x8A, 0x97, 0xB6, 0x83, 0x88, 0x8C, 0x93, 0x96, 0x89, 0x8B, 0x81, 0x98, 0x87, 0x80, 0xB4,
|
||||
0xB5, 0x91, 0x92
|
||||
0x82, 0x90, 0x85, 0x8A, 0x97, 0xB6, 0x83, 0x88, 0x8C, 0x93, 0x96, 0x89, 0x8B, 0x81, 0x98, 0x87, 0x80,
|
||||
0xB4, 0xB5, 0x91, 0x92
|
||||
};
|
||||
const string German = "äöüßÄÖÜ";
|
||||
readonly byte[] GermanBytes = {0x84, 0x94, 0x81, 0x9E, 0x8E, 0x99, 0x9A};
|
||||
@@ -66,28 +66,32 @@ namespace Claunia.Encoding.Tests
|
||||
readonly byte[] NorwegianBytes = {0x91, 0xB3, 0x86, 0x92, 0xB2, 0x8F};
|
||||
const string Portuguese = "áéíóúÉâêôãõÃÕçÇ";
|
||||
readonly byte[] PortugueseBytes =
|
||||
{0xA0, 0x82, 0xA1, 0xA2, 0xA3, 0x90, 0x83, 0x88, 0x93, 0xB0, 0xB1, 0xB7, 0xB8, 0x87, 0x80};
|
||||
{
|
||||
0xA0, 0x82, 0xA1, 0xA2, 0xA3, 0x90, 0x83, 0x88, 0x93, 0xB0, 0xB1, 0xB7, 0xB8, 0x87, 0x80
|
||||
};
|
||||
const string Dutch = "ijIJ";
|
||||
readonly byte[] DutchBytes = {0xC0, 0xC1};
|
||||
const string Hebrew = "אבגדהוזחטיכלמנסעפצקרשתןךםףץ";
|
||||
readonly byte[] HebrewBytes =
|
||||
{
|
||||
0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3,
|
||||
0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC
|
||||
0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2,
|
||||
0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC
|
||||
};
|
||||
const string Greek = "αβΓπΣσµτΦΘΩδ¯";
|
||||
readonly byte[] GreekBytes = {0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xFF};
|
||||
|
||||
const string Typographic = "ªº«»¨´†¶©®™§°∙·";
|
||||
readonly byte[] TypographicBytes =
|
||||
{0xA6, 0xA7, 0xAE, 0xAF, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, 0xDD, 0xF8, 0xF9, 0xFA};
|
||||
{
|
||||
0xA6, 0xA7, 0xAE, 0xAF, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, 0xDD, 0xF8, 0xF9, 0xFA
|
||||
};
|
||||
const string Currency = "¢£¥ƒ";
|
||||
readonly byte[] CurrencyBytes = {0x9B, 0x9C, 0x9D, 0x9F};
|
||||
const string Mathematics = "⌐¬½¼∧∞∮ϕ∈∩≡±≥≤⌠⌡÷≈√ⁿ²³";
|
||||
readonly byte[] MathematicsBytes =
|
||||
{
|
||||
0xA9, 0xAA, 0xAB, 0xAC, 0xDE, 0xDF, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
|
||||
0xFB, 0xFC, 0xFD, 0xFE
|
||||
0xA9, 0xAA, 0xAB, 0xAC, 0xDE, 0xDF, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6,
|
||||
0xF7, 0xFB, 0xFC, 0xFD, 0xFE
|
||||
};
|
||||
const string Symbols = "⇧⇩⇨⇦❎✓♪ə";
|
||||
readonly byte[] SymbolsBytes = {0x01, 0x02, 0x03, 0x04, 0x05, 0x08, 0x0B, 0x1A};
|
||||
|
||||
@@ -34,22 +34,22 @@ namespace Claunia.Encoding.Tests
|
||||
const string Punctuations = "!\"#$%&()*+,-./:;<=>?@[\\]^_{|}~";
|
||||
readonly byte[] PunctuationsBytes =
|
||||
{
|
||||
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x3A, 0x3B, 0x3C, 0x3D,
|
||||
0x3E, 0x3F, 0x40, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x7B, 0x7C, 0x7D, 0x7E
|
||||
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x3A, 0x3B, 0x3C,
|
||||
0x3D, 0x3E, 0x3F, 0x40, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x7B, 0x7C, 0x7D, 0x7E
|
||||
};
|
||||
const string Digits = "0123456789";
|
||||
readonly byte[] DigitsBytes = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39};
|
||||
const string UpperLatin = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
readonly byte[] UpperLatinBytes =
|
||||
{
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52,
|
||||
0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51,
|
||||
0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A
|
||||
};
|
||||
const string LowerLatin = "abcdefghijklmnopqrstuvwxyz";
|
||||
readonly byte[] LowerLatinBytes =
|
||||
{
|
||||
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72,
|
||||
0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A
|
||||
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71,
|
||||
0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A
|
||||
};
|
||||
|
||||
const string Spanish = "¡¿áéíóúüñÉÜÑ";
|
||||
@@ -57,8 +57,8 @@ namespace Claunia.Encoding.Tests
|
||||
const string French = "éÉàèùÀâêîôûëïüÿçÇœŒæÆ";
|
||||
readonly byte[] FrenchBytes =
|
||||
{
|
||||
0x8E, 0x83, 0x88, 0x8F, 0x9D, 0xCB, 0x89, 0x90, 0x94, 0x99, 0x9E, 0x91, 0x95, 0x9F, 0xD8, 0x8D, 0x82, 0xCF,
|
||||
0xCE, 0xBE, 0xAE
|
||||
0x8E, 0x83, 0x88, 0x8F, 0x9D, 0xCB, 0x89, 0x90, 0x94, 0x99, 0x9E, 0x91, 0x95, 0x9F, 0xD8, 0x8D, 0x82,
|
||||
0xCF, 0xCE, 0xBE, 0xAE
|
||||
};
|
||||
const string German = "äöüßÄÖÜ";
|
||||
readonly byte[] GermanBytes = {0x8A, 0x9A, 0x9F, 0xA7, 0x80, 0x85, 0x86};
|
||||
@@ -66,21 +66,23 @@ namespace Claunia.Encoding.Tests
|
||||
readonly byte[] NorwegianBytes = {0xBE, 0xBF, 0x8C, 0xAE, 0xAF, 0x81};
|
||||
const string Portuguese = "áéíóúÉâêôãõÃÕçÇ";
|
||||
readonly byte[] PortugueseBytes =
|
||||
{0x87, 0x8E, 0x92, 0x97, 0x9C, 0x83, 0x89, 0x90, 0x99, 0x8B, 0x9B, 0xCC, 0xCD, 0x8D, 0x82};
|
||||
{
|
||||
0x87, 0x8E, 0x92, 0x97, 0x9C, 0x83, 0x89, 0x90, 0x99, 0x8B, 0x9B, 0xCC, 0xCD, 0x8D, 0x82
|
||||
};
|
||||
|
||||
const string Typographic = "†°•¶®©™´¨ªº«»…–—“”‘’§";
|
||||
readonly byte[] TypographicBytes =
|
||||
{
|
||||
0xA0, 0xA1, 0xA5, 0xA6, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xBB, 0xBC, 0xC7, 0xC8, 0xC9, 0xD0, 0xD1, 0xD2, 0xD3,
|
||||
0xD4, 0xD5, 0xA4
|
||||
0xA0, 0xA1, 0xA5, 0xA6, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xBB, 0xBC, 0xC7, 0xC8, 0xC9, 0xD0, 0xD1, 0xD2,
|
||||
0xD3, 0xD4, 0xD5, 0xA4
|
||||
};
|
||||
const string Currency = "¢£¥";
|
||||
readonly byte[] CurrencyBytes = {0xA2, 0xA3, 0xB4};
|
||||
const string Mathematics = "≠∞±≤≥µ∂∑∏π∫Ω¬√ƒ≈∆÷◊";
|
||||
readonly byte[] MathematicsBytes =
|
||||
{
|
||||
0xAD, 0xB0, 0xB1, 0xB2, 0xB3, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBD, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xD6,
|
||||
0xD7
|
||||
0xAD, 0xB0, 0xB1, 0xB2, 0xB3, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBD, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6,
|
||||
0xD6, 0xD7
|
||||
};
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -35,20 +35,22 @@ namespace Claunia.Encoding.Tests
|
||||
readonly byte[] PunctuationsBytes = {0b00000001, 0b11000110, 0b11011101};
|
||||
const string Digits = "0123456789";
|
||||
readonly byte[] DigitsBytes =
|
||||
{0b01111001, 0b11111000, 0b00100001, 0b10001010, 0b00111001, 0b00100101, 0b10011010, 0b01110000};
|
||||
{
|
||||
0b01111001, 0b11111000, 0b00100001, 0b10001010, 0b00111001, 0b00100101, 0b10011010, 0b01110000
|
||||
};
|
||||
const string UpperLatin = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
readonly byte[] UpperLatinBytes =
|
||||
{
|
||||
0b00000100, 0b00100000, 0b11000100, 0b00010100, 0b01100001, 0b11001000, 0b00100100, 0b10100010, 0b11001100,
|
||||
0b00110100, 0b11100011, 0b11010000, 0b01000101, 0b00100100, 0b11010100, 0b01010101, 0b01100101, 0b11011000,
|
||||
0b01100101, 0b10100000
|
||||
0b00000100, 0b00100000, 0b11000100, 0b00010100, 0b01100001, 0b11001000, 0b00100100, 0b10100010,
|
||||
0b11001100, 0b00110100, 0b11100011, 0b11010000, 0b01000101, 0b00100100, 0b11010100, 0b01010101,
|
||||
0b01100101, 0b11011000, 0b01100101, 0b10100000
|
||||
};
|
||||
const string Sentence = "THIS IS A TEST$";
|
||||
const string SentencePadded = "THIS IS A TEST$ "; // It gets space padded when decoding is not multiple
|
||||
readonly byte[] SentenceBytes =
|
||||
{
|
||||
0b01010000, 0b10000010, 0b01010011, 0b00000000, 0b10010100, 0b11000000, 0b00000100, 0b00000101, 0b00000101,
|
||||
0b01001101, 0b01000110, 0b11000000
|
||||
0b01010000, 0b10000010, 0b01010011, 0b00000000, 0b10010100, 0b11000000, 0b00000100, 0b00000101,
|
||||
0b00000101, 0b01001101, 0b01000110, 0b11000000
|
||||
};
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a ATASCII character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">ATASCII character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return ATASCIITable[character];
|
||||
}
|
||||
static char GetChar(byte character) => ATASCIITable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an ATASCII character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Apple II character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Apple II character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return Apple2Table[character];
|
||||
}
|
||||
static char GetChar(byte character) => Apple2Table[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Apple II character
|
||||
|
||||
@@ -231,10 +231,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -313,20 +311,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -389,10 +381,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -446,20 +435,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -468,20 +451,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Apple IIc character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Apple IIc character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return Apple2cTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => Apple2cTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Apple IIc character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Apple IIe character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Apple IIe character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return Apple2eTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => Apple2eTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Apple IIe character
|
||||
|
||||
@@ -231,10 +231,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -313,20 +311,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -389,10 +381,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -446,20 +435,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -468,20 +451,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Apple IIgs character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Apple IIgs character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return Apple2gsTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => Apple2gsTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Apple IIgs character
|
||||
|
||||
@@ -231,10 +231,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -313,20 +311,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -389,10 +381,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -446,20 +435,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -468,20 +451,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Atari ST character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Atari ST character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return AtariSTTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => AtariSTTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Atari ST character
|
||||
|
||||
@@ -130,14 +130,12 @@ namespace Claunia.Encoding
|
||||
/// Returns an array that contains all encodings.
|
||||
/// </summary>
|
||||
/// <returns>An array that contains all encodings.</returns>
|
||||
public new static IEnumerable<EncodingInfo> GetEncodings()
|
||||
{
|
||||
return (from type in Assembly.GetExecutingAssembly().GetTypes()
|
||||
where type.IsSubclassOf(typeof(Encoding))
|
||||
let encoding = (Encoding)type.GetConstructor(new Type[] { }).Invoke(new object[] { })
|
||||
select new EncodingInfo(encoding.CodePage, encoding.BodyName, encoding.EncodingName, false, type))
|
||||
.ToArray();
|
||||
}
|
||||
public new static IEnumerable<EncodingInfo> GetEncodings() =>
|
||||
(from type in Assembly.GetExecutingAssembly().GetTypes()
|
||||
where type.IsSubclassOf(typeof(Encoding))
|
||||
let encoding = (Encoding)type.GetConstructor(new Type[] { }).Invoke(new object[] { })
|
||||
select new EncodingInfo(encoding.CodePage, encoding.BodyName, encoding.EncodingName, false, type))
|
||||
.ToArray();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the encoding associated with the specified code page name.
|
||||
|
||||
@@ -11,8 +11,8 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
public sealed class EncodingInfo
|
||||
{
|
||||
bool isSystem;
|
||||
Type thisType;
|
||||
bool isSystem;
|
||||
readonly Type thisType;
|
||||
|
||||
internal EncodingInfo(int codePage, string name, string displayName, bool system = true,
|
||||
Type internalType = null)
|
||||
@@ -49,10 +49,7 @@ namespace Claunia.Encoding
|
||||
/// A <see cref="T:Claunia.Encoding.Encoding" /> object that corresponds to the current
|
||||
/// <see cref="T:Claunia.Encoding.EncodingInfo" /> object.
|
||||
/// </returns>
|
||||
public Encoding GetEncoding()
|
||||
{
|
||||
return (Encoding)thisType.GetConstructor(new Type[] { }).Invoke(new object[] { });
|
||||
}
|
||||
public Encoding GetEncoding() => (Encoding)thisType.GetConstructor(new Type[] { }).Invoke(new object[] { });
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the specified object is equal to the current EncodingInfo object.
|
||||
@@ -62,18 +59,12 @@ namespace Claunia.Encoding
|
||||
/// <c>true</c> if value is a <see cref="T:Claunia.Encoding.EncodingInfo" /> and is equal to the current
|
||||
/// <see cref="T:Claunia.Encoding.EncodingInfo" />; otherwise, <c>false</c>.
|
||||
/// </returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
return value is EncodingInfo that && CodePage == that.CodePage;
|
||||
}
|
||||
public override bool Equals(object value) => value is EncodingInfo that && CodePage == that.CodePage;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the hash code for the current EncodingInfo object.
|
||||
/// </summary>
|
||||
/// <returns>A 32-bit signed integer hash code.</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return CodePage;
|
||||
}
|
||||
public override int GetHashCode() => CodePage;
|
||||
}
|
||||
}
|
||||
@@ -231,10 +231,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -313,20 +311,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -389,10 +381,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -446,20 +435,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -468,20 +451,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a GEM character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">GEM character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return GemTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => GemTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an GEM character
|
||||
|
||||
@@ -232,10 +232,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -314,20 +312,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -390,10 +382,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -447,20 +436,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -469,20 +452,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a GEOS character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">GEOS character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return GeosTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => GeosTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an GEOS character
|
||||
|
||||
@@ -231,10 +231,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -313,20 +311,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -389,10 +381,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -446,20 +435,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -468,20 +451,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a LisaRoman character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">LisaRoman character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return LisaRomanTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => LisaRomanTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an LisaRoman character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Mac Arabic character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Mac Arabic character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return MacArabicTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => MacArabicTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Mac Arabic character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Mac CentralEuropean character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Mac CentralEuropean character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return MacCentralEuropeanTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => MacCentralEuropeanTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Mac CentralEuropean character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Mac Croatian character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Mac Croatian character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return MacCroatianTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => MacCroatianTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Mac Croatian character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Mac Cyrillic character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Mac Cyrillic character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return MacCyrillicTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => MacCyrillicTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Mac Cyrillic character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Mac Farsi character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Mac Farsi character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return MacFarsiTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => MacFarsiTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Mac Farsi character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Mac Greek character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Mac Greek character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return MacGreekTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => MacGreekTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Mac Greek character
|
||||
|
||||
@@ -233,10 +233,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -315,20 +313,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -391,10 +383,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -448,20 +437,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -470,20 +453,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Mac Hebrew character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Mac Hebrew character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return MacHebrewTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => MacHebrewTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Mac Hebrew character
|
||||
|
||||
@@ -231,10 +231,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -313,20 +311,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -389,10 +381,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -446,20 +435,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -468,20 +451,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a MacRoman character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">MacRoman character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return MacRomanTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => MacRomanTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an MacRoman character
|
||||
|
||||
@@ -231,10 +231,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -313,20 +311,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -389,10 +381,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -446,20 +435,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -468,20 +451,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a MacRomanian character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">MacRomanian character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return MacRomanianTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => MacRomanianTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an MacRomanian character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Mac Turkish character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Mac Turkish character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return MacTurkishTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => MacTurkishTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Mac Turkish character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Mac Ukrainian character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Mac Ukrainian character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return MacUkrainianTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => MacUkrainianTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Mac Ukrainian character
|
||||
|
||||
@@ -231,10 +231,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -313,20 +311,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -389,10 +381,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -446,20 +435,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -468,20 +451,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a PETSCII character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">PETSCII character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return PETSCIITable[character];
|
||||
}
|
||||
static char GetChar(byte character) => PETSCIITable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an PETSCII character
|
||||
|
||||
@@ -182,10 +182,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -295,20 +293,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -371,10 +363,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -454,20 +443,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -476,20 +459,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Apple II character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">Apple II character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return Radix50Table[character & 0x3F];
|
||||
}
|
||||
static char GetChar(byte character) => Radix50Table[character & 0x3F];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an Apple II character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a ZX80 character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">ZX80 character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return ZX80Table[character];
|
||||
}
|
||||
static char GetChar(byte character) => ZX80Table[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an ZX80 character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a ZX81 character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">ZX81 character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return ZX81Table[character];
|
||||
}
|
||||
static char GetChar(byte character) => ZX81Table[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an ZX81 character
|
||||
|
||||
@@ -230,10 +230,8 @@ namespace Claunia.Encoding
|
||||
/// <param name="charCount">The number of characters to encode.</param>
|
||||
/// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
|
||||
/// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
|
||||
{
|
||||
return GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
}
|
||||
public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) =>
|
||||
GetBytes(s.ToCharArray(), charIndex, charCount, bytes, byteIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Encodes all the characters in the specified string into a sequence of bytes.
|
||||
@@ -312,20 +310,14 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A byte array containing the results of encoding the specified set of characters.</returns>
|
||||
/// <param name="chars">The character array containing the characters to encode.</param>
|
||||
public override byte[] GetBytes(char[] chars)
|
||||
{
|
||||
return GetBytes(chars, 0, chars.Length);
|
||||
}
|
||||
public override byte[] GetBytes(char[] chars) => GetBytes(chars, 0, chars.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding all the bytes in the specified byte array.
|
||||
/// </summary>
|
||||
/// <returns>The number of characters produced by decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override int GetCharCount(byte[] bytes)
|
||||
{
|
||||
return GetCharCount(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override int GetCharCount(byte[] bytes) => GetCharCount(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
||||
@@ -388,10 +380,7 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
/// <returns>A character array containing the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override char[] GetChars(byte[] bytes)
|
||||
{
|
||||
return GetChars(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override char[] GetChars(byte[] bytes) => GetChars(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
|
||||
@@ -445,20 +434,14 @@ namespace Claunia.Encoding
|
||||
/// Returns a sequence of bytes that specifies the encoding used.
|
||||
/// </summary>
|
||||
/// <returns>A byte array of length zero, as a preamble is not required.</returns>
|
||||
public override byte[] GetPreamble()
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
public override byte[] GetPreamble() => new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// Decodes all the bytes in the specified byte array into a string.
|
||||
/// </summary>
|
||||
/// <returns>A string that contains the results of decoding the specified sequence of bytes.</returns>
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes)
|
||||
{
|
||||
return GetString(bytes, 0, bytes.Length);
|
||||
}
|
||||
public override string GetString(byte[] bytes) => GetString(bytes, 0, bytes.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a sequence of bytes from the specified byte array into a string.
|
||||
@@ -467,20 +450,15 @@ namespace Claunia.Encoding
|
||||
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
|
||||
/// <param name="index">The index of the first byte to decode.</param>
|
||||
/// <param name="count">The number of bytes to decode.</param>
|
||||
public override string GetString(byte[] bytes, int index, int count)
|
||||
{
|
||||
return new string(GetChars(bytes, index, count));
|
||||
}
|
||||
public override string GetString(byte[] bytes, int index, int count) =>
|
||||
new string(GetChars(bytes, index, count));
|
||||
|
||||
/// <summary>
|
||||
/// Converts a ZX Spectrum character to an Unicode character
|
||||
/// </summary>
|
||||
/// <returns>Unicode character.</returns>
|
||||
/// <param name="character">ZX Spectrum character.</param>
|
||||
static char GetChar(byte character)
|
||||
{
|
||||
return ZXSpectrumTable[character];
|
||||
}
|
||||
static char GetChar(byte character) => ZXSpectrumTable[character];
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Unicode character to an ZX Spectrum character
|
||||
|
||||
Reference in New Issue
Block a user