Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public int read() throws IOException
            public override int Read()
            {
                if (NumLeft > 0)
                {
                    int b = @is.Read();
                    Jv.Update(b, Mev);
                    NumLeft--;
                    if (NumLeft == 0)
                    {
                        Jv.Update(-1, Mev);
                    }
                    return(b);
                }
                else
                {
                    return(-1);
                }
            }
Exemplo n.º 2
0
        /// <summary>
        /// Reads from the current JAR file entry into an array of bytes.
        /// If <code>len</code> is not zero, the method
        /// blocks until some input is available; otherwise, no
        /// bytes are read and <code>0</code> is returned.
        /// If verification has been enabled, any invalid signature
        /// on the current entry will be reported at some point before the
        /// end of the entry is reached. </summary>
        /// <param name="b"> the buffer into which the data is read </param>
        /// <param name="off"> the start offset in the destination array <code>b</code> </param>
        /// <param name="len"> the maximum number of bytes to read </param>
        /// <returns> the actual number of bytes read, or -1 if the end of the
        ///         entry is reached </returns>
        /// <exception cref="NullPointerException"> If <code>b</code> is <code>null</code>. </exception>
        /// <exception cref="IndexOutOfBoundsException"> If <code>off</code> is negative,
        /// <code>len</code> is negative, or <code>len</code> is greater than
        /// <code>b.length - off</code> </exception>
        /// <exception cref="ZipException"> if a ZIP file error has occurred </exception>
        /// <exception cref="IOException"> if an I/O error has occurred </exception>
        /// <exception cref="SecurityException"> if any of the jar file entries
        ///         are incorrectly signed. </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public int read(byte[] b, int off, int len) throws IOException
        public override int Read(sbyte[] b, int off, int len)
        {
            int n;

            if (First == null)
            {
                n = base.Read(b, off, len);
            }
            else
            {
                n = -1;
            }
            if (Jv != null)
            {
                Jv.Update(n, b, off, len, Mev);
            }
            return(n);
        }