Package java.io

Examples of java.io.EOFException


            byte2 = in.read();
            byte3 = in.read();
            byte4 = in.read();
        }
        if (byte4 == -1) {
            throw new EOFException();
        }
        return (byte4 << 24) + (byte3 << 16) + (byte2 << 8) + byte1;
    }
View Full Code Here


        long byte5 = in.read();
        long byte6 = in.read();
        long byte7 = in.read();
        long byte8 = in.read();
        if (byte8 == -1) {
            throw new EOFException();
        }
        return (byte8 << 56) + (byte7 << 48) + (byte6 << 40) + (byte5 << 32)
                + (byte4 << 24) + (byte3 << 16) + (byte2 << 8) + byte1;
    }
View Full Code Here

    public String readLEUTF() throws IOException {
        int byte1 = in.read();
        int byte2 = in.read();
        if (byte2 == -1)
            throw new EOFException();
        int numbytes = (byte1 << 8) + byte2;

        char result[] = new char[numbytes];
        int numread = 0;
        int numchars = 0;
View Full Code Here

    private void refillBuffer() throws IOException, EOFException {
        firstbyteoffset += (curptr + bytesinbuffer);
        int err = super.read(buffer, 0, buffer.length);
        curptr = 0;
        if (err == -1)
            throw new EOFException();
        bytesinbuffer = err;
    }
View Full Code Here

                int err = super.read(buffer, bytesinbuffer, buffer.length
                        - bytesinbuffer);
                if (err == -1) {

                    if (available() <= 0) {
                        throw new EOFException("BinaryBufferedFile, no bytes at all, trying to read "
                                + minlength);
                    } else {
                        throw new FormatException("BinaryBufferedFile: failed to read "
                                + minlength
                                + " bytes, with "
View Full Code Here

                        return retval;
                    } else { // some kind of failure...
                        if (gotsofar > 0) {
                            throw new FormatException("EOF while reading");
                        } else {
                            throw new EOFException();
                        }
                    }
                }

                gotsofar += err;
View Full Code Here

     */
    public char readChar() throws EOFException, FormatException {
        try {
            int retv = read();
            if (retv == -1) {
                throw new EOFException("Error in ReadChar, EOF reached");
            }
            return (char) retv;
        } catch (IOException i) {
            throw new FormatException("IOException in ReadChar: "
                    + i.getMessage());
View Full Code Here

                        return retval;
                    } else { //some kind of failure...
                        if (gotsofar > 0) {
                            throw new FormatException("StreamInputReader: EOF while reading data");
                        } else {
                            throw new EOFException();
                        }
                    }
                }
                gotsofar += err;
            }
View Full Code Here

    public char readChar() throws EOFException, FormatException {
        try {
            int retv = inputReader.read();

            if (retv == -1) {
                throw new EOFException("Error in ReadChar, EOF reached");
            }
            return (char) retv;
        } catch (IOException i) {
            throw new FormatException("readChar IOException: " + i.getMessage());
        }
View Full Code Here

     * @exception IOException Any IO errors encountered in reading from the file
     */
    public int readUnsigned() throws IOException, EOFException {
        byte b = (byte) read();
        if (b == -1) {
            throw new EOFException();
        }
        return MoreMath.signedToInt(b);
    }
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.