CSJ2K.j2k.util.ISRandomAccessIO.readInput C# (CSharp) Метод

readInput() приватный Метод

Reads data from the wrapped InputStream and places it in the cache buffer. Reads all input data that will not cause it to block, but at least on byte is read (even if it blocks), unless EOF is reached. This method can not be called if EOF has been already reached (i.e. 'complete' is true). The wrapped InputStream is closed if the EOF is reached.
An I/O error occurred, out of meory to grow /// cache or maximum cache size reached. /// ///
private readInput ( ) : void
Результат void
        private void readInput()
        {
            int n;
            //int b;
            int k;

            if (complete)
            {
                throw new System.ArgumentException("Already reached EOF");
            }
            long available;
            available = is_Renamed.Length - is_Renamed.Position;
            n = (int) available; /* how much can we read without blocking? */
            if (n == 0)
                n = 1; /* read at least one byte (even if it blocks) */
            while (len + n > buf.Length)
            {
                /* Ensure buffer size */
                growBuffer();
            }
            /* Read the data. Loop to be sure that we do read 'n' bytes */
            do
            {
                // CONVERSION PROBLEM? OPTIMIZE!!!
                k = is_Renamed.Read(buf, len, n);
                if (k > 0)
                {
                    /* Some data was read */
                    len += k;
                    n -= k;
                }
            }
            while (n > 0 && k > 0);
            if (k <= 0)
            {
                /* we reached EOF */
                complete = true;
                is_Renamed.Dispose();
                is_Renamed = null;
            }
        }