Package java.io

Examples of java.io.EOFException


    @Override
    protected ObjectStreamClass readClassDescriptor()
            throws IOException, ClassNotFoundException {
        int type = read();
        if (type < 0) {
            throw new EOFException();
        }
        switch (type) {
        case CompactObjectOutputStream.TYPE_PRIMITIVE:
            return super.readClassDescriptor();
        case CompactObjectOutputStream.TYPE_NON_PRIMITIVE:
View Full Code Here


  private void fillBuffer() throws IOException, EOFException {
    while (count < buffer.length) {
          int read = in.read(buffer, count, buffer.length - count);
          if (read == -1) {
            throw new EOFException();
          }
          count += read;
        }
        count = 0;
  }
View Full Code Here

    if (length > buf.length) buf = new byte[length];
   
    int nb = -1;
    do {
      nb = is.read(buf, count, length-count);
      if (nb < 0) throw new EOFException();
      count += nb;
    } while (count != length);
    return buf;
  }
View Full Code Here

    int count = 0;
   
    int nb = -1;
    do {
      nb = is.read(buf, count, buf.length-count);
      if (nb < 0) throw new EOFException();
      count += nb;
    } while (count != buf.length);
  }
View Full Code Here

        return length;
    }

    public void readFully(byte[] b, int off, int len) throws IOException {
        if (pos + len > length) {
            throw new EOFException();
        }
        System.arraycopy(data, pos, b, off, len);
        pos += len;
    }
View Full Code Here

    public void readFully(byte[] b, int off, int len) throws IOException {
        long pos = getFilePointer();
        long length = length();
        if (pos + len > length) {
            throw new EOFException("pos: " + pos + " len: " + len + " length: " + length);
        }
        int posMod = (int) (pos % BLOCK_SIZE);
        if (posMod == 0 && len % BLOCK_SIZE == 0) {
            readAligned(pos, b, off, len);
        } else {
View Full Code Here

            }
            inPos = pos;
        }
        int l = IOUtils.readFully(in, b, off, len);
        if (l != len) {
            throw new EOFException();
        }
        pos += len;
        inPos += len;
    }
View Full Code Here

                } else if (element.equals(insertStartMarker)) {
                    // Skip the previous auto-generated content
                    while (true) {
                        current = reader.read();
                        if (current < 0) {
                            throw new EOFException();
                        }
                        if (current == '<') {
                            element = getElement(reader);
                            if (element.equals(insertEndMarker)) {
                                break;
View Full Code Here

       
        while (!done) {
            int current = reader.read();
            while (current != '>') {
                if (current < 0) {
                    throw new EOFException();
                }
                result.append((char) current);
                current = reader.read();
            }
            result.append((char) current);
View Full Code Here

                } else if (element.equals(insertStartMarker)) {
                    // Skip the previous auto-generated content
                    while (true) {
                        current = reader.read();
                        if (current < 0) {
                            throw new EOFException();
                        }
                        if (current == '<') {
                            element = getElement(reader);
                            if (element.equals(insertEndMarker)) {
                                break;
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.