예제 #1
0
        /// <summary>
        /// Gets bytes for a string from this table.
        /// </summary>
        public ArrayView <byte> GetBytes(StringId id)
        {
            GetBytesCore(id, out byte[] buffer, out int index, out int length);

            if (buffer[index] == Utf16Marker)
            {
                index++;     // skip the marker
                length *= 2; // utf16 uses 2 bytes per character
            }

            return(ArrayView.Create(buffer, index, length));
        }