Package java.io

Examples of java.io.EOFException


                byteval = in.read();
            } catch (IOException ioe) {
                throw new FormatException(ioe.getMessage());
            }
            if (byteval == -1) {
                throw new EOFException();
            }
            return byteval;
        }
        case 2:
            return MoreMath.signedToInt(in.readShort());
View Full Code Here


     */
    public DcwColumnInfo(BinaryFile inputFile) throws EOFException,
            FormatException {
        char delim = inputFile.readChar();
        if (delim == ';')
            throw new EOFException();

        StringBuffer buildstring = new StringBuffer();
        do {
            buildstring.append(Character.toLowerCase(delim));
        } while ((delim = inputFile.readChar()) != '=');
View Full Code Here

        {
            int b = _in.read();

            if (b < 0)
            {
                throw new EOFException();
            }

            --_length;
            return b;
        }
View Full Code Here

        {
            int toRead = Math.min(len, _length);
            int numRead = _in.read(buf, off, toRead);

            if (numRead < 0)
                throw new EOFException();

            _length -= numRead;
            return numRead;
        }
View Full Code Here

            {
                int read = _in.read(bytes, pos, _length - pos);

                if (read < 0)
                {
                    throw new EOFException();
                }

                pos += read;
            }
            while (pos < _length);
View Full Code Here

            }
        }

        if (left != 0)
        {
            throw new EOFException("EOF encountered in middle of object");
        }
    }
View Full Code Here

        int tag = read();
        if (tag == -1)
        {
            if (eofFound)
            {
                throw new EOFException("attempt to read past end of file.");
            }

            eofFound = true;

            return null;
View Full Code Here

            }

            if (b < 0)
            {
                eofFound = true;
                throw new EOFException("EOF found inside tag value.");
            }
           
            tagNo |= (b & 0x7f);
        }
       
View Full Code Here

        throws IOException
    {
        int length = _in.read();
        if (length < 0)
        {
            throw new EOFException("EOF found when length expected");
        }

        if (length == 0x80)
        {
            return -1;      // indefinite-length encoding
        }

        if (length > 127)
        {
            int size = length & 0x7f;

            if (size > 4)
            {
                throw new IOException("DER length more than 4 bytes");
            }

            length = 0;
            for (int i = 0; i < size; i++)
            {
                int next = _in.read();

                if (next < 0)
                {
                    throw new EOFException("EOF found reading length");
                }

                length = (length << 8) + next;
            }
View Full Code Here

        int tag = _in.read();
        if (tag == -1)
        {
            if (_eofFound)
            {
                throw new EOFException("attempt to read past end of file.");
            }

            _eofFound = true;

            return null;
        }

        //
        // turn of looking for "00" while we resolve the tag
        //
        set00Check(false);

        //
        // calculate tag number
        //
        int baseTagNo = tag & ~DERTags.CONSTRUCTED;
        int tagNo = baseTagNo;

        if ((tag & DERTags.TAGGED) != 0)
        {
            tagNo = tag & 0x1f;

            //
            // with tagged object tag number is bottom 5 bits, or stored at the start of the content
            //
            if (tagNo == 0x1f)
            {
                tagNo = 0;

                int b = _in.read();

                while ((b >= 0) && ((b & 0x80) != 0))
                {
                    tagNo |= (b & 0x7f);
                    tagNo <<= 7;
                    b = _in.read();
                }

                if (b < 0)
                {
                    _eofFound = true;

                    throw new EOFException("EOF encountered inside tag value.");
                }

                tagNo |= (b & 0x7f);
            }
        }
View Full Code Here

TOP

Related Classes of java.io.EOFException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.