Read zero or more high-scoring segment pairs from the specified readable.

@param readable to read from, must not be null
@return zero or more high-scoring segment pairs read from the specified readable
@throws IOException if an I/O error occurs
439783
public static Iterable<HighScoringPair> read(final Readable readable) throws IOException {
        checkNotNull(readable);
        Collect collect = new Collect();
        stream(readable, collect);
        return collect.hsps();
    }
1310392
public String readLineUntilBoundary() throws IOException {
		StringBuilder bldr = new StringBuilder();
		while (true) {
			int b = read();
			if (bldr.indexOf(boundary) == 0) {
				leftover = ByteBuffer.wrap(boundaryBytes);
				return null;
			} else if (b == -1 || b == 10) {
				break;
			} else if (b != '\r') {
				bldr.append((char) ((byte) b));
			}
		}
		return bldr.toString();
	}
971913
public <M extends FMatrix>M read32() throws IOException {
        List<String> words = extractWords();

        if( words.size() == 3 ) {
            int numRows = Integer.parseInt(words.get(0));
            int numCols = Integer.parseInt(words.get(1));
            boolean real = words.get(2).compareToIgnoreCase("real") == 0;

            if (numRows < 0 || numCols < 0)
                throw new IOException("Invalid number of rows and/or columns: " + numRows + " " + numCols);

            if (real)
                return (M) readFDRM(numRows, numCols);
            else
                return (M) readCDRM(numRows, numCols);
        } else if ( words.size() == 4 ) {
            int numRows = Integer.parseInt(words.get(0));
            int numCols = Integer.parseInt(words.get(1));
            int length = Integer.parseInt(words.get(2));
            boolean real = words.get(3).compareToIgnoreCase("real") == 0;

            if (numRows < 0 || numCols < 0)
                throw new IOException("Invalid number of rows and/or columns: " + numRows + " " + numCols);

            if (real)
                return (M) readFSTR(numRows, numCols, length);
            else
                throw new IllegalArgumentException("Sparse complex not yet supported");
        } else {
            throw new IOException("Unexpected number of words on the first line. Found "+words.size());
        }
    }
805246
public final int readTTFLong() throws IOException {
        long ret = readTTFUByte();    // << 8;
        ret = (ret << 8) + readTTFUByte();
        ret = (ret << 8) + readTTFUByte();
        ret = (ret << 8) + readTTFUByte();

        return (int)ret;
    }
1319937
protected final int readBytes()
        throws IOException
    {
        _inputPtr = 0;
        _inputEnd = 0;
        if (_inputSource != null) {
            int count = _inputSource.read(_inputBuffer, 0, _inputBuffer.length);
            if (count > 0) {
                _inputEnd = count;
            }
            return count;
        }
        return -1;
    }
769507
public String[] readLines() throws IOException {

        List<String> list = new ArrayList<String>();
        String line;
        while ((line = readLine()) != null) {
            list.add(line);
        }

        return list.toArray(new String[0]);
    }
304652
public static String readFully(BufferedReader reader) throws IOException {
        if (reader == null) {
            return null;
        }

        StringBuilder sb = new StringBuilder(BUFFER_SIZE);
        char[] buf = new char[BUFFER_SIZE];
        try {
            int len;
            // read until we reach then end which is the -1 marker
            while ((len = reader.read(buf)) != -1) {
                sb.append(buf, 0, len);
            }
        } finally {
            IOHelper.close(reader, "reader", LOG);
        }

        return sb.toString();
    }
297444
static Reader asReader(final Readable readable) {
    checkNotNull(readable);
    if (readable instanceof Reader) {
      return (Reader) readable;
    }
    return new Reader() {
      @Override
      public int read(char[] cbuf, int off, int len) throws IOException {
        return read(CharBuffer.wrap(cbuf, off, len));
      }

      @Override
      public int read(CharBuffer target) throws IOException {
        return readable.read(target);
      }

      @Override
      public void close() throws IOException {
        if (readable instanceof Closeable) {
          ((Closeable) readable).close();
        }
      }
    };
  }
1047526
@Override
	public int read(byte[] b, int off, int len) throws IOException
    {
        if (len == 0)
            return 0;
        
        int totalRead = 0;
        do
        {
            int amount = readBufferedOrAvailable(b,off+totalRead,len-totalRead);
            if (amount <= 0)
                return (totalRead == 0) ? amount : totalRead;
            totalRead += amount;
            
            // Did we get enough ?
            if (totalRead >= len)
                break;
        }
        while (in.available() > 0);
        
        return totalRead;
    }
1151157
public int read() throws IOException {
    // Read the next non-whitespace character
    int x;
    do {
      x = in.read();
      if (x == -1) {
        return -1;
      }
    } while (Character.isWhitespace((char) x));
    charCount++;

    // The '=' sign is just padding
    if (x == '=') {
      return -1; // effective end of stream
    }

    // Convert from raw form to 6-bit form
    x = ints[x];

    // Calculate which character we're decoding now
    int mode = (charCount - 1) % 4;

    // First char save all six bits, go for another
    if (mode == 0) {
      carryOver = x & 63;
      return read();
    }
    // Second char use previous six bits and first two new bits,
    // save last four bits
    else if (mode == 1) {
      int decoded = ((carryOver << 2) + (x >> 4)) & 255;
      carryOver = x & 15;
      return decoded;
    }
    // Third char use previous four bits and first four new bits,
    // save last two bits
    else if (mode == 2) {
      int decoded = ((carryOver << 4) + (x >> 2)) & 255;
      carryOver = x & 3;
      return decoded;
    }
    // Fourth char use previous two bits and all six new bits
    else if (mode == 3) {
      int decoded = ((carryOver << 6) + x) & 255;
      return decoded;
    }
    return -1; // can't actually reach this line
  }
855882
@Nullable
  public ICommonsList <String> readNext () throws IOException
  {
    ICommonsList <String> ret = null;
    do
    {
      final String sNextLine = _getNextLine ();
      if (!m_bHasNext)
      {
        // should throw if still pending?
        return ret;
      }
      final ICommonsList <String> r = m_aParser.parseLineMulti (sNextLine);
      if (ret == null)
        ret = r;
      else
        ret.addAll (r);
    } while (m_aParser.isPending ());
    return ret;
  }
197279
@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
	private E readPolyElement(int elementIndex, ShapeElementType type) throws IOException {
		final boolean hasZ = type.hasZ();
		final boolean hasM = type.hasM();

		// Ignore the bounds stored inside the file
		skipBytes(8 * 4);

		// Count of parts
		final int numParts;
		if (type == ShapeElementType.MULTIPOINT || type == ShapeElementType.MULTIPOINT_Z
				|| type == ShapeElementType.MULTIPOINT_M) {
			numParts = 0;
		} else {
			numParts = readLEInt();
		}

		// Count of points
		final int numPoints = readLEInt();

		// Read the parts' indexes
		final int[] parts = new int[numParts];
		for (int idxParts = 0; idxParts < numParts; ++idxParts) {
			parts[idxParts] = readLEInt();
		}

		// Read the points
		final ESRIPoint[] points = new ESRIPoint[numPoints];

		for (int idxPoints = 0; idxPoints < numPoints; ++idxPoints) {
			// Read coordinates
			final double x = fromESRI_x(readLEDouble());
			final double y = fromESRI_y(readLEDouble());

			// Create point
			if (!Double.isNaN(x) && !Double.isNaN(y)) {
				points[idxPoints] = new ESRIPoint(x, y);
			} else {
				throw new ShapeFileException("invalid (x,y) coordinates"); //$NON-NLS-1$
			}
		} // for i= 0 to numPoints

		if (hasZ) {
			// Zmin and Zmax: 2*Double - ignored
			skipBytes(2 * 8);
			// Z array: numpoints*Double
			double z;
			for (int i = 0; i < numPoints; ++i) {
				z = fromESRI_z(readLEDouble());
				if (!Double.isNaN(z)) {
					points[i].setZ(z);
				}
			}
		}

		if (hasM) {
			// Mmin and Mmax: 2*Double - ignored
			skipBytes(2 * 8);
			// M array: numpoints*Double
			double measure;
			for (int i = 0; i < numPoints; ++i) {
				measure = fromESRI_m(readLEDouble());
				if (!Double.isNaN(measure)) {
					points[i].setM(measure);
				}
			}
		}

		// Create the instance of the element
		E newElement = null;
		switch (type) {
		case POLYGON_Z:
		case POLYGON_M:
		case POLYGON:
			newElement = createPolygon(createAttributeCollection(elementIndex), elementIndex, parts, points, hasZ);
			break;
		case POLYLINE_Z:
		case POLYLINE_M:
		case POLYLINE:
			newElement = createPolyline(createAttributeCollection(elementIndex), elementIndex, parts, points, hasZ);
			break;
		case MULTIPOINT:
		case MULTIPOINT_M:
		case MULTIPOINT_Z:
			newElement = createMultiPoint(createAttributeCollection(elementIndex), elementIndex, points, hasZ);
			break;
			//$CASES-OMITTED$
		default:
		}

		return newElement;
	}
1207808
public int read(byte[] b, int off, int len) throws IOException {
        checkForClosed();
        if (b == null) {
            throw new NullPointerException();
        } else if ((off < 0) || (len < 0) || ((off + len) > b.length)) {
            throw new IndexOutOfBoundsException();
        } else if (len == 0) {
            return 0;
        }

        loadBytesAsNeeded();
        int bytesImmediatelyAvailable = bytesLeftInBuffer();
        if (len <= bytesImmediatelyAvailable) {
            System.arraycopy(_bytes, _currentBufferPosition, b, off, len);
            _currentBufferPosition += len;
            return len;
        }

        int bytesRead = EOF;
        if (bytesImmediatelyAvailable > 0) {
            bytesRead = read(b, off, bytesImmediatelyAvailable);
            if (bytesRead != EOF) {
                int furtherBytesRead = read(b, off + bytesRead, len - bytesRead);
                if (furtherBytesRead != EOF) {
                    bytesRead += furtherBytesRead;
                }
            }
        }
        return bytesRead;
    }
196310
public int read() throws IOException {
    if (chunk == null || pos + 1 == chunk.length) {
      if (!fetchChunk()) {
        return -1;
      }
    }
    return chunk[pos++] & 0xff;
  }
101050
public String getHumanReadableAge(final int[] readableAge)
	{
		if (null == readableAge || readableAge.length != 6)
		{
			throw new IllegalArgumentException(
				"Int array should not be null and the length should be equal 6.");
		}
		final StringBuilder result = new StringBuilder();
		result.append("Your are ");
		result.append(readableAge[0]).append(" years");
		result.append(" ");
		result.append(readableAge[1]).append(" months");
		result.append(" ");
		result.append(readableAge[2]).append(" days");
		result.append(" ");
		result.append(readableAge[3]).append(" hours");
		result.append(" ");
		result.append(readableAge[4]).append(" minutes");
		result.append(" ");
		result.append(readableAge[5]).append(" seconds");
		result.append(" young!");
		return result.toString();
	}
83648
public static byte [] readLine(LineReader lineReader) 
  throws IOException {
    Text out = new Text();
    long bytes = lineReader.readLine(out);
    if (bytes <= 0)
      return null;
    return out.getBytes();
  }
1246550
protected <T> T readReadable(Class<T> clazz) throws IOException {
      try {
         T object = Reflect.onClass(clazz).allowPrivilegedAccess().create().get();
         JsonSerializable readable = Cast.as(object);
         boolean isArray = JsonArraySerializable.class.isAssignableFrom(clazz);//(object instanceof ArrayValue);
         if (isArray && peek() == JsonTokenType.BEGIN_ARRAY) {
            beginArray();
         } else if (peek() == JsonTokenType.BEGIN_OBJECT) {
            beginObject();
         }
         readable.fromJson(this);
         if (isArray && peek() == JsonTokenType.END_ARRAY) {
            endArray();
         } else if (peek() == JsonTokenType.END_OBJECT) {
            endObject();
         }
         return object;
      } catch (ReflectionException e) {
         throw new IOException(e);
      }
   }