Package java.io

Examples of java.io.EOFException


    public void readFully(byte[] b, int off, int len) throws IOException {
        if (len == 0) {
            return;
        }
        if (channel.position() + len > length) {
            throw new EOFException();
        }
        ByteBuffer buf = ByteBuffer.wrap(b);
        buf.position(off);
        buf.limit(off + len);
        channel.read(buf);
View Full Code Here


                changeLength(end);
            } else {
                if (len == 0) {
                    return pos;
                }
                throw new EOFException("File: " + name);
            }
        }
        while (len > 0) {
            int l = (int) Math.min(len, BLOCK_SIZE - (pos & BLOCK_SIZE_MASK));
            int page = (int) (pos >>> BLOCK_SIZE_SHIFT);
View Full Code Here

        return l;
    }

    public void readFully(byte[] b, int off, int len) throws IOException {
        if (filePointer + len > length) {
            throw new EOFException();
        }
        while (true) {
            int l = read(b, off, len);
            len -= l;
            if (len <= 0) {
View Full Code Here

     * Read data from our channel into the buffer
     */
    final int read = this.in.read(this.buffer);

    if (read == -1) {
      throw new EOFException();
    }

    if (read < length) {
      throw new BufferUnderflowException();
    }
View Full Code Here

    public static void skipFully(InputStream in, long skip) throws IOException {
        try {
            while (skip > 0) {
                long skipped = in.skip(skip);
                if (skipped <= 0) {
                    throw new EOFException();
                }
                skip -= skipped;
            }
        } catch (Exception e) {
            throw DbException.convertToIOException(e);
View Full Code Here

    public static void skipFully(Reader reader, long skip) throws IOException {
        try {
            while (skip > 0) {
                long skipped = reader.skip(skip);
                if (skipped <= 0) {
                    throw new EOFException();
                }
                skip -= skipped;
            }
        } catch (Exception e) {
            throw DbException.convertToIOException(e);
View Full Code Here

     * the file
     */
    public short readShort() throws EOFException {
        //MSBFirst must be set when we are called
        if (iv_bytesinbuffer < 2) {
            throw new EOFException();
        }
        iv_curptr += 2;
        iv_bytesinbuffer -= 2;
        return MoreMath.BuildShort(iv_buffer, iv_curptr - 2, true);
    }
View Full Code Here

     */
    public short readLEShort() throws IOException {
        int byte1 = in.read();
        int byte2 = in.read();
        if (byte2 == -1)
            throw new EOFException();
        return (short) ((byte2 << 8) + byte1);
    }
View Full Code Here

     */
    public int readLEUnsignedShort() throws IOException {
        int byte1 = in.read();
        int byte2 = in.read();
        if (byte2 == -1)
            throw new EOFException();
        return (byte2 << 8) + byte1;
    }
View Full Code Here

     */
    public char readLEChar() throws IOException {
        int byte1 = in.read();
        int byte2 = in.read();
        if (byte2 == -1)
            throw new EOFException();
        return (char) ((byte2 << 8) + byte1);
    }
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.