Ejemplo n.º 1
0
        public static void Convert(this System.Text.Decoder decoder, Collections.Buffer <byte> bytes, Collections.Buffer <char> charBuffer)
        {
            int  bytesUsed;
            int  charsUsed;
            bool completed;

            decoder.Convert(bytes, charBuffer, out bytesUsed, out charsUsed, out completed);
        }
Ejemplo n.º 2
0
        public static int Read(this System.IO.TextReader reader, Collections.Buffer <char> buffer)
        {
            if (buffer.EndOffset == buffer.Capacity)
            {
                throw new ArgumentException("buffer", "Buffer is full");
            }
            int count = reader.Read(buffer.Array, buffer.StartOffset, buffer.Capacity - buffer.EndOffset);

            buffer.EndOffset += count;
            return(count);
        }
Ejemplo n.º 3
0
 public static void Convert(this System.Text.Decoder decoder, Collections.Buffer <byte> bytes, Collections.Buffer <char> charBuffer, out int bytesUsed, out int charsUsed, out bool completed)
 {
     decoder.Convert(bytes.Array, bytes.StartOffset, bytes.Count, charBuffer.Array, charBuffer.EndOffset, charBuffer.Capacity - charBuffer.EndOffset, false, out bytesUsed, out charsUsed, out completed);
     bytes.StartOffset    += bytesUsed;
     charBuffer.EndOffset += charsUsed;
 }