Ends an Array

@return the structured reader
@throws IOException Something went wrong reading
2975
public JsonReader endArray() throws IOException {
      if (currentValue.getKey() != END_ARRAY) {
         throw new IOException("Expecting END_ARRAY, but found " + jsonTokenToStructuredElement(null));
      }
      consume();
      return this;
   }
834747
public boolean reachEnd() throws IOException {
		// check if we have a read row that was not returned yet
		if (readRecord != null && !readRecordReturned) {
			return false;
		}
		// check if there are more rows to be read
		if (numReadRecords >= numTotalRecords) {
			return true;
		}
		// try to read next row
		return !readNextRecord();
	}
761354
private void closeDataReader() throws IOException {
    if (mCurrentChunk != null) {
      mCurrentChunk.release();
      mCurrentChunk = null;
    }
    if (mDataReader != null) {
      mDataReader.close();
    }
    mDataReader = null;
  }
334970
public byte []
readByteArray() {
	int len = remaining();
	byte [] out = new byte[len];
	byteBuffer.get(out, 0, len);
	return out;
}
1252683
public String[] readNext() {
    String[] result = null;
    do {
      String nextLine = getNextLine();
      if (!hasNext) { return result; // should throw if still pending?
      }
      String[] r = parser.parseLineMulti(nextLine);
      if (r.length > 0) {
        if (result == null) {
          result = r;
        } else {
          String[] t = new String[result.length + r.length];
          System.arraycopy(result, 0, t, 0, result.length);
          System.arraycopy(r, 0, t, result.length, r.length);
          result = t;
        }
      }
    } while (parser.isPending());
    return result;
  }
392013
public int read() throws IOException {
        if (end == endFilled) {
            switch (pages.read(endPageIdx, endFilled)) {
                case -1:
                    eof = true;
                    return Scanner.EOF;
                case 0:
                    endFilled = pages.getFilled(endPageIdx);
                    break;
                case 1:
                    endPageIdx++;
                    end = 0;
                    endPage = pages.get(endPageIdx);
                    endFilled = pages.getFilled(endPageIdx);
                    break;
                default:
                    throw new RuntimeException();
            }
        }
        return endPage[end++];
    }
144938
public PdfArray readArray() throws IOException {
        PdfArray array = new PdfArray();
        while (true) {
            PdfObject obj = readPRObject();
            int type = obj.type();
            if (-type == PRTokeniser.TK_END_ARRAY)
                break;
            if (-type == PRTokeniser.TK_END_DIC)
                throw new IOException("Unexpected '>>'");
            array.add(obj);
        }
        return array;
    }
1167787
public Reader getReader() throws IOException {
        if (this.charset != null) {
            return new InputStreamReader(this.resource.getInputStream(), this.charset);
        } else if (this.encoding != null) {
            return new InputStreamReader(this.resource.getInputStream(), this.encoding);
        } else {
            return new InputStreamReader(this.resource.getInputStream());
        }
    }
752931
public int read() throws IOException {
        byte[] b = new byte[1];
        int bytesRead = read(b, 0, 1);
        if (bytesRead == EOF) {
            return EOF;
        } else {
        //byte type in Java is from -128 to +127 and we are supposed to return 0-255
            return b[0] & 0xFF;
        }
    }
1166847
public List<Object> parseArray() throws IOException {
		Type t = lexer.readNextToken();
		if (t != Type.START_ARRAY) {
			throw new IOException("Unexpected token: " + t);
		}
		
		return parseArrayInternal();
	}
1073532
@Override public void close() throws IOException
   {
      long skippedLast = 0;
      if (m_remaining > 0)
      {
         skippedLast = skip(m_remaining);
         while (m_remaining > 0 && skippedLast > 0)
         {
            skippedLast = skip(m_remaining);
         }
      }
   }
922088
public List<FutureReadResultEntry> close() {
        List<FutureReadResultEntry> result;
        synchronized (this.reads) {
            if (this.closed) {
                result = Collections.emptyList();
            } else {
                result = new ArrayList<>(this.reads);
                this.reads.clear();
                this.closed = true;
            }
        }

        return result;
    }
536677
private byte[] getRootHeader() throws IOException
   {
      ByteArrayOutputStream outStream = new ByteArrayOutputStream();

      int[] rootHeader =
         {0x4C, 0x50, 0x00, 0x01, 0x42, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
            0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00};
      writeInts(rootHeader, outStream);

      return outStream.toByteArray();
   }
1215082
@Override
    public int read() throws IOException {
        // initalize the lookahead
        if (lookaheadChar == UNDEFINED) {
            lookaheadChar = super.read();
        }
        lastChar = lookaheadChar;
        if (super.ready()) {
            lookaheadChar = super.read();
        } else {
            lookaheadChar = UNDEFINED;
        }
        if (lastChar == '\n') {
            lineCounter++;
        }
        return lastChar;
    }
1020413
public JSONWriter objectEnd() throws IOException {
        writer.write(JSON.RBRACE);
        state = stack.pop();
        return this;
    }
1308812
public EncodedElement getEnd() {
    EncodedElement temp = next;
    EncodedElement end = this;
    while(temp != null) {
      end = temp;
      temp = temp.next;
    }
    return end;
  }
1053832
public byte[] readBytes() throws IORuntimeException {
		long len = file.length();
		if (len >= Integer.MAX_VALUE) {
			throw new IORuntimeException("File is larger then max array size");
		}

		byte[] bytes = new byte[(int) len];
		FileInputStream in = null;
		int readLength;
		try {
			in = new FileInputStream(file);
			readLength = in.read(bytes);
			if(readLength < len){
				throw new IOException(StrUtil.format("File length is [{}] but read [{}]!", len, readLength));
			}
		} catch (Exception e) {
			throw new IORuntimeException(e);
		} finally {
			IoUtil.close(in);
		}

		return bytes;
	}