IndexOfByte() 정적인 개인적인 메소드

static private IndexOfByte ( byte src, byte value, int index, int count ) : int
src byte
value byte
index int
count int
리턴 int
예제 #1
0
파일: String.cs 프로젝트: PeterSolMS/corert
        private static unsafe string Ctor(sbyte *value)
        {
            byte *pb = (byte *)value;

            if (pb == null)
            {
                return(string.Empty);  // Compatibility
            }
            int numBytes = Buffer.IndexOfByte(pb, 0, 0, int.MaxValue);

            if (numBytes < 0)                                               // This check covers the "-1 = not-found" case and "negative length" case (downstream code assumes length is non-negative).
            {
                throw new ArgumentException(SR.Arg_ExpectedNulTermination); // We'll likely have AV'd before we get to this point, but just in case...
            }
            return(CreateStringForSByteConstructor(pb, numBytes));
        }