Package java.io

Examples of java.io.EOFException


    while (n > 0) {
      long amt = reader.skip(n);
      if (amt == 0) {
        // force a blocking read
        if (reader.read() == -1) {
          throw new EOFException();
        }
        n--;
      } else {
        n -= amt;
      }
View Full Code Here


   * @throws IOException if an I/O error occurs.
   */
  public static void readFully(InputStream in, byte[] b, int off, int len)
      throws IOException {
    if (read(in, b, off, len) != len) {
      throw new EOFException();
    }
  }
View Full Code Here

    while (n > 0) {
      long amt = in.skip(n);
      if (amt == 0) {
        // Force a blocking read to avoid infinite loop
        if (in.read() == -1) {
          throw new EOFException();
        }
        n--;
      } else {
        n -= amt;
      }
View Full Code Here

  @Override
  public int readUnsignedByte() throws IOException {
    int b1 = in.read();
    if (0 > b1) {
      throw new EOFException();
    }
   
    return b1;
  }
View Full Code Here

   */
  private byte readAndCheckByte() throws IOException, EOFException {
    int b1 = in.read();

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

    return (byte) b1;
  }
View Full Code Here

  
  public static final short readUInt8(InputStream in) throws IOException {
    int ch = in.read();
    if (ch < 0) {
      throw new EOFException();
    }
    return (short) (ch & 0xff);
  }
View Full Code Here

                    log.warn(MessageFormat.format(Messages.getString("HttpClient.eof.givingUp"), new Object[] { new Integer(i) })); //$NON-NLS-1$                   
                }
                // #endif
            }
        }
        throw new EOFException(Messages.getString("HttpClient.couldNotConnect")); //$NON-NLS-1$
    }
View Full Code Here

                 
                  inputBuffer.compact();
                  int read = rawIn.read(bufferIn);
   
                  if(read==-1)
                    throw new EOFException("Unexpected EOF whilst waiting for SSL unwrap");
                
                  inputBuffer.put(bufferIn, 0, read);
                  inputBuffer.flip();
                }
   
View Full Code Here

        while (true) {
            c = in.read();

            if (c == -1) {
                if (lineBuf.length() == 0)
                    throw new EOFException(Messages.getString("HttpResponse.unexpectedEOF")); //$NON-NLS-1$

                break;
            }

            if (c != '\n') {
View Full Code Here

            while (len > 0 && chunkLength > 0) {

                read = in.read(buf, off, (int) (len > chunkLength ? chunkLength : len));

                if (read == -1)
                    throw new EOFException(Messages.getString("HttpResponse.unexpectedEOFDuringChunking")); //$NON-NLS-1$

                chunkLength -= read;
                len -= read;
                off += read;
                count += read;
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.