ReadAllIntoByteArray() private method

private ReadAllIntoByteArray ( byte buf ) : void
buf byte
return void
Esempio n. 1
0
        internal static byte[] GetBuffer(DefiniteLengthInputStream defIn, byte[][] tmpBuffers)
        {
            int remaining = defIn.GetRemaining();

            if (remaining >= tmpBuffers.Length)
            {
                return(defIn.ToArray());
            }
            byte[] buf = tmpBuffers[remaining];
            if (buf == null)
            {
                buf = tmpBuffers[remaining] = new byte[remaining];
            }
            defIn.ReadAllIntoByteArray(buf);
            return(buf);
        }
Esempio n. 2
0
        private static byte[] GetBuffer(DefiniteLengthInputStream defIn, byte[][] tmpBuffers)
        {
            int len = defIn.Remaining;

            if (len >= tmpBuffers.Length)
            {
                return(defIn.ToArray());
            }

            byte[] buf = tmpBuffers[len];
            if (buf == null)
            {
                buf = tmpBuffers[len] = new byte[len];
            }

            defIn.ReadAllIntoByteArray(buf);

            return(buf);
        }
        internal static byte[] GetBuffer(DefiniteLengthInputStream defIn, byte[][] tmpBuffers)
        {
            int len = defIn.GetRemaining();
            if (len >= tmpBuffers.Length)
            {
                return defIn.ToArray();
            }

            byte[] buf = tmpBuffers[len];
            if (buf == null)
            {
                buf = tmpBuffers[len] = new byte[len];
            }

            defIn.ReadAllIntoByteArray(buf);

            return buf;
        }