System.Xml.XmlEventCache.ToBytes C# (CSharp) Méthode

ToBytes() private static méthode

Create a standalone buffer that doesn't need an index or count passed along with it.
private static ToBytes ( byte buffer, int index, int count ) : byte[]
buffer byte
index int
count int
Résultat byte[]
        private static byte[] ToBytes(byte[] buffer, int index, int count) {
            if (index != 0 || count != buffer.Length) {
                if (buffer.Length - index > count)
                    count = buffer.Length - index;

                byte[] bufferNew = new byte[count];
                Array.Copy(buffer, index, bufferNew, 0, count);

                return bufferNew;
            }

            return buffer;
        }