internal string PeekUTF16WithSize(
     int offset,
     int byteCount
     )
 {
     return(MemoryReader.ScanUTF16WithSize(_currentPointer + offset, byteCount));
 }
        internal string ReadUTF16WithSize(
            int byteCount
            )
        {
            string retString = MemoryReader.ScanUTF16WithSize(_currentPointer, byteCount);

            _currentPointer += byteCount;
            return(retString);
        }
        internal string PeekUTF16WithSize(
            int offset,
            int byteCount
            )
        {
            if (checked (this.CurrentPointer - this.Buffer + offset + byteCount) > this.Length)
            {
                throw new ArgumentOutOfRangeException();
            }

            return(MemoryReader.ScanUTF16WithSize(this.CurrentPointer + offset, byteCount));
        }
        internal string ReadUTF16WithSize(
            int byteCount
            )
        {
            if (checked (this.CurrentPointer - this.Buffer + byteCount) > this.Length)
            {
                throw new ArgumentOutOfRangeException();
            }
            string retString = MemoryReader.ScanUTF16WithSize(this.CurrentPointer, byteCount);

            this.CurrentPointer += byteCount;
            return(retString);
        }
        internal string PeekUTF16WithShortSize(
            int offset,
            out int numberOfBytesRead
            )
        {
            int length = this.PeekUInt16(offset);

#if !COMPACTFX
#if LITTLEENDIAN
            string result = new string((char *)(_currentPointer + offset + sizeof(UInt16)), 0, length);
#elif BIGENDIAN
            string result = new string((sbyte *)(this.CurrentPointer + offset + sizeof(UInt16)), 0, length *sizeof(Char), Encoding.Unicode);
#endif
#else
            string result = MemoryReader.ScanUTF16WithSize(this.CurrentPointer + offset, length * sizeof(Char));
#endif
            numberOfBytesRead = sizeof(UInt16) + result.Length * sizeof(Char);
            return(result);
        }
        internal string PeekUTF16WithShortSize(
            int offset,
            out int numberOfBytesRead
            )
        {
            int length = this.PeekUInt16(offset);

            if (checked (this.CurrentPointer - this.Buffer + offset + sizeof(UInt16) + length * sizeof(Char)) > this.Length)
            {
                throw new ArgumentOutOfRangeException();
            }

#if !COMPACTFX && !__MonoCS__
#if LITTLEENDIAN
            string result = new string((char *)(this.CurrentPointer + offset + sizeof(UInt16)), 0, length);
#elif BIGENDIAN
            string result = new string((sbyte *)(this.CurrentPointer + offset + sizeof(UInt16)), 0, length *sizeof(Char), Encoding.Unicode);
#endif
#else
            string result = MemoryReader.ScanUTF16WithSize(this.CurrentPointer + offset + sizeof(UInt16), length * sizeof(Char));
#endif
            numberOfBytesRead = sizeof(UInt16) + result.Length * sizeof(Char);
            return(result);
        }