Exemplo n.º 1
0
        public DictionaryTerm GetTerm(string term)
        {
            long offset = 0;

            if (!dictionary.TryGet(encoding.GetBytes(term), out offset))
            {
                throw new InvalidOperationException();
            }

            return(new DictionaryTerm(term, new PostingListAddress(offset)));
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="value"></param>
        /// <param name="encoding"></param>
        public void WriteValue(char value, Encoding encoding)
        {
            ITextEncoding e = Encodings.GetEncoding(encoding);
            byte *        p = (byte *)m_Allocator.GetMemoryPtr(m_ByteCount + 3, m_ByteCount).ToPointer();

            m_ByteCount += e.GetBytes(value, p);
        }
Exemplo n.º 3
0
 public static IEnumerable <byte> GetBytes(this ITextEncoding encoding, string text) => encoding.GetBytes(text, 0, text.Length);