Contract.EndContractBlock();
// If no input, return 0, avoid fixed empty array problem
- if (chars.Length == 0)
+ if (count == 0)
return 0;
// Just call the pointer version
Contract.EndContractBlock();
// If nothing to encode return 0, avoid fixed problem
- if (chars.Length == 0)
+ if (charCount == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// If no input just return 0, fixed doesn't like 0 length arrays
- if (bytes.Length == 0)
+ if (count == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// If no input, return 0 & avoid fixed problem
- if (bytes.Length == 0)
+ if (byteCount == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// Avoid problems with empty input buffer
- if (bytes.Length == 0) return String.Empty;
+ if (byteCount == 0) return String.Empty;
fixed (byte* pBytes = bytes)
return String.CreateStringFromEncoding(
[System.Runtime.InteropServices.ComVisible(false)]
public virtual void Reset()
{
- byte[] byteTemp = {};
+ byte[] byteTemp = Array.Empty<byte>();
char[] charTemp = new char[GetCharCount(byteTemp, 0, 0, true)];
GetChars(byteTemp, 0, 0, charTemp, 0, true);
if (m_fallbackBuffer != null)
Contract.EndContractBlock();
// If no input, return 0, avoid fixed empty array problem
- if (chars.Length == 0)
+ if (count == 0)
return 0;
// Just call the pointer version
Contract.EndContractBlock();
// If nothing to encode return 0, avoid fixed problem
- if (chars.Length == 0)
+ if (charCount == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// If no input just return 0, fixed doesn't like 0 length arrays
- if (bytes.Length == 0)
+ if (count == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// If no input, return 0 & avoid fixed problem
- if (bytes.Length == 0)
+ if (byteCount == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// Avoid problems with empty input buffer
- if (bytes.Length == 0) return String.Empty;
+ if (count == 0) return String.Empty;
fixed (byte* pBytes = bytes)
return String.CreateStringFromEncoding(
Contract.EndContractBlock();
// If no input, return 0, avoid fixed empty array problem
- if (chars.Length == 0)
+ if (count == 0)
return 0;
// Just call the pointer version
Contract.EndContractBlock();
// If nothing to encode return 0, avoid fixed problem
- if (chars.Length == 0)
+ if (charCount == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// If no input just return 0, fixed doesn't like 0 length arrays.
- if (bytes.Length == 0)
+ if (count == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// If no input, return 0 & avoid fixed problem
- if (bytes.Length == 0)
+ if (byteCount == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// Avoid problems with empty input buffer
- if (bytes.Length == 0) return String.Empty;
+ if (count == 0) return String.Empty;
fixed (byte* pBytes = bytes)
return String.CreateStringFromEncoding(
Contract.EndContractBlock();
// If no input, return 0, avoid fixed empty array problem
- if (chars.Length == 0)
+ if (count == 0)
return 0;
// Just call the pointer version
Contract.EndContractBlock();
// If nothing to encode return 0, avoid fixed problem
- if (chars.Length == 0)
+ if (charCount == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// If no input just return 0, fixed doesn't like 0 length arrays.
- if (bytes.Length == 0)
+ if (count == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// If no input, return 0 & avoid fixed problem
- if (bytes.Length == 0)
+ if (byteCount == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// Avoid problems with empty input buffer
- if (bytes.Length == 0) return String.Empty;
+ if (count == 0) return String.Empty;
fixed (byte* pBytes = bytes)
return String.CreateStringFromEncoding(
Contract.EndContractBlock();
// If no input, return 0, avoid fixed empty array problem
- if (chars.Length == 0)
+ if (count == 0)
return 0;
// Just call the pointer version
Contract.EndContractBlock();
// If nothing to encode return 0, avoid fixed problem
- if (chars.Length == 0)
+ if (charCount == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// If no input just return 0, fixed doesn't like 0 length arrays.
- if (bytes.Length == 0)
+ if (count == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// If no input, return 0 & avoid fixed problem
- if (bytes.Length == 0)
+ if (byteCount == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// Avoid problems with empty input buffer
- if (bytes.Length == 0) return String.Empty;
+ if (count == 0) return String.Empty;
fixed (byte* pBytes = bytes)
return String.CreateStringFromEncoding(
Contract.EndContractBlock();
// If no input, return 0, avoid fixed empty array problem
- if (chars.Length == 0)
+ if (count == 0)
return 0;
// Just call the pointer version
Contract.EndContractBlock();
// If nothing to encode return 0, avoid fixed problem
- if (chars.Length == 0)
+ if (charCount == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// If no input just return 0, fixed doesn't like 0 length arrays
- if (bytes.Length == 0)
+ if (count == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// If no input, return 0 & avoid fixed problem
- if (bytes.Length == 0)
+ if (byteCount == 0)
return 0;
// Just call pointer version
Contract.EndContractBlock();
// Avoid problems with empty input buffer
- if (bytes.Length == 0) return String.Empty;
+ if (count == 0) return String.Empty;
fixed (byte* pBytes = bytes)
return String.CreateStringFromEncoding(