Package java.io

Examples of java.io.EOFException


    // Override fill() method to provide an extra "dummy" byte
    // at the end of the input stream. This is required when
    // using the "nowrap" Inflater option.
    protected void fill() throws IOException {
        if (eof) {
      throw new EOFException(
          "Unexpected end of ZLIB input stream");
        }
        len = this.in.read(buf, 0, buf.length);
        if (len == -1) {
      buf[0] = 0;
View Full Code Here


     */
    protected void fill() throws IOException {
  ensureOpen();
  len = in.read(buf, 0, buf.length);
  if (len == -1) {
      throw new EOFException("Unexpected end of ZLIB input stream");
  }
  inf.setInput(buf, 0, len);
    }
View Full Code Here

     * Reads unsigned byte.
     */
    private int readUByte(InputStream in) throws IOException {
  int b = in.read();
  if (b == -1) {
      throw new EOFException();
  }
        if (b < -1 || b > 255) {
            // Report on this.in, not argument in; see read{Header, Trailer}.
            throw new IOException(this.in.getClass().getName()
                + ".read() returned value out of range -1..255: " + b);
View Full Code Here

     */
    private void skipBytes(InputStream in, int n) throws IOException {
  while (n > 0) {
      int len = in.read(tmpbuf, 0, n < tmpbuf.length ? n : tmpbuf.length);
      if (len == -1) {
    throw new EOFException();
      }
      n -= len;
  }
    }
View Full Code Here

    @Override
    protected Value nextValue() {
        if(in == null) {
            // FIXME exception
            throw new MessageTypeException(new EOFException());
        }
        return super.nextValue();
    }
View Full Code Here

    public int read(byte[] b, int off, int len) throws IOException {
        int remain = len;
        while(remain > 0) {
            int n = in.read(b, off, remain);
            if(n <= 0) {
                throw new EOFException();
            }
            remain -= n;
            off += n;
        }
        return len;
View Full Code Here

    }

    public byte readByte() throws IOException {
        int n = in.read();
        if(n < 0) {
            throw new EOFException();
        }
        return (byte)n;
    }
View Full Code Here

    private void require(int len) throws IOException {
        while(filled < len) {
            int n = in.read(castBuffer, filled, len - filled);
            if(n < 0) {
                throw new EOFException();
            }
            filled += n;
        }
    }
View Full Code Here

    private void readRawBodyCont() throws IOException {
        int len = in.read(raw, rawFilled, raw.length - rawFilled);
        rawFilled += len;
        if(rawFilled < raw.length) {
            throw new EOFException();
        }
    }
View Full Code Here

                n = channel.read(dstBuffer);
            }
//            System.out.println("Read in " + n + " bytes");
            if (n < 0) {
                if (total < 1) {
                    throw new EOFException();
                }
                break;
            }               
            position += n;
            total += n;               
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.