Package java.io

Examples of java.io.EOFException


            if (contentLength == 0 || con == null) {
                return -1;
            } else {
                int b = con.getInputStream().read();
                if (b == -1)
                    throw new EOFException(MessageFormat.format(Messages.getString("HttpResponse.unexpectedEOFInResponseExpected"), new Object[] { new Long(contentLength) })); //$NON-NLS-1$
                contentLength--;

                if (contentLength == 0)
                    close();
View Full Code Here


            if (contentLength == 0 || con == null) {
                return -1;
            } else {
                int read = con.getInputStream().read(buf, off, (contentLength > len ? len : (int) contentLength));
                if (read == -1)
                    throw new EOFException(MessageFormat.format(Messages.getString("HttpResponse.unexpectedEOFInResponseExpected"), new Object[] { new Long(contentLength) })); //$NON-NLS-1$ //$NON-NLS-2$
                contentLength -= read;

                if (contentLength == 0)
                    close();
View Full Code Here

       throw new IndexOutOfBoundsException();
   int n = 0;
   while (n < len) {
       int count = read(b, off + n, len - n);
       if (count < 0)
        throw new EOFException();
       n += count;
   }
  }
View Full Code Here

    int ch1 = read();
    int ch2 = read();
    int ch3 = read();
    int ch4 = read();
    if ((ch1 | ch2 | ch3 | ch4) < 0)
        throw new EOFException();
    return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0)) & 0xFFFFFFFFL;

  }
View Full Code Here

  public short readShort() throws IOException {
    int ch1 = read();
    int ch2 = read();

    if ( (ch1 | ch2) < 0) {
      throw new EOFException();
    }

    return (short) ( (ch1 << 8) + (ch2 << 0));
  }
View Full Code Here

    // #ifdef DEBUG
    if (log.isDebugEnabled())
      log.debug("Message could not be found");
    // #endif

    throw new EOFException("The required message could not be found in the message store");
  }
View Full Code Here

        throws IOException
    {
        int tag = read();
        if (tag == -1)
        {
            throw new EOFException();
        }

        int     length = readLength();

        if (length < 0)    // indefinite length method
View Full Code Here

                                // #endif

                                sendMessage(ALERT_PROTOCOL, new byte[] { (byte) WARNING_ALERT, (byte) SSLException.CLOSE_NOTIFY });
                                // close();
                                // Let the InputStream know that we're at EOF
                                throw new EOFException();

                            default:

                                // #ifdef DEBUG
                                log.warn(SSLException.getDescription(fragment[1]));
View Full Code Here

            lastIP = startAddress;
        } else {
            if (endAddress == null || "".equals(endAddress)) {
                String addressString = IPUtils.createAddressString(IPUtils.calcLastAddress(net, networkBits));
                if (lastIP.equals(addressString))
                    throw new EOFException("No more IPs available");
            } else {
                if (lastIP.equals(endAddress))
                    throw new EOFException("No more IPs available");
            }

            lastIP = IPUtils.createAddressString(IPUtils.nextAddress(IPUtils.getByteAddress(lastIP)));
        }
View Full Code Here

        {
          int  l = read(bytes, bytes.length - left, left);

          if (l < 0)
          {
            throw new EOFException("unexpected end of stream");
          }

          left -= l;
        }
    }
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.