Retrieve a Double from an input stream.

@param is input stream
@return Double instance
198521
public static final Double getDouble(InputStream is) throws IOException
   {
      double result = Double.longBitsToDouble(getLong(is));
      if (Double.isNaN(result))
      {
         result = 0;
      }
      return Double.valueOf(result);
   }
780061
public static boolean isDouble(String s) {
		try {
			Double.parseDouble(s);
			if (s.contains(".")) {
				return true;
			}
			return false;
		} catch (NumberFormatException e) {
			return false;
		}
	}
630686
public double getDouble(String key) {
    if (containsKey(key)) {
      return Double.parseDouble(get(key));
    } else {
      throw new IllegalArgumentException("Missing key " + key + ".");
    }
  }
1264505
public static ByteBuffer getByteBufferFromInputStreamAndCloseStream(InputStream is) throws IOException {
        try {
            // is.available() may return 0, or 1, or the total number of bytes in the stream,
            // or some other number.
            // Do not try to use is.available() == 0 to find the end of the stream!
            byte[] bytes;
            int avail = is.available();
            if (avail > 32) {
                // There are more bytes available than just the ICU data header length.
                // With luck, it is the total number of bytes.
                bytes = new byte[avail];
            } else {
                bytes = new byte[128];  // empty .res files are even smaller
            }
            // Call is.read(...) until one returns a negative value.
            int length = 0;
            for(;;) {
                if (length < bytes.length) {
                    int numRead = is.read(bytes, length, bytes.length - length);
                    if (numRead < 0) {
                        break;  // end of stream
                    }
                    length += numRead;
                } else {
                    // See if we are at the end of the stream before we grow the array.
                    int nextByte = is.read();
                    if (nextByte < 0) {
                        break;
                    }
                    int capacity = 2 * bytes.length;
                    if (capacity < 128) {
                        capacity = 128;
                    } else if (capacity < 0x4000) {
                        capacity *= 2;  // Grow faster until we reach 16kB.
                    }
                    // TODO Java 6 replace new byte[] and arraycopy(): bytes = Arrays.copyOf(bytes, capacity);
                    byte[] newBytes = new byte[capacity];
                    System.arraycopy(bytes, 0, newBytes, 0, length);
                    bytes = newBytes;
                    bytes[length++] = (byte) nextByte;
                }
            }
            return ByteBuffer.wrap(bytes, 0, length);
        } finally {
            is.close();
        }
    }
125651
@SuppressWarnings("unchecked")
    public static <T> T readObject(InputStream is) {
        try {
            ObjectInputStream ois = new ObjectInputStream(is);
            T ret = (T) ois.readObject();
            ois.close();
            return ret;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

    }
149146
private static byte[] getBytes(InputStream is) throws IOException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();

        byte[] buf = new byte[4096];

        while (true) {
            int r = is.read(buf);
            if (r == -1) {
                out.flush();
                return out.toByteArray();
            }
            out.write(buf, 0, r);
        }
    }
445896
@Override
	public Double getPropertyDouble(String key)
	{
		Double iVal = null;
		String sVal = getProperty(key);

		if ((sVal != null) && (sVal.length() > 0))
		{

			iVal = Double.valueOf(sVal);

		}
		return iVal;

	}
1038881
public static DoubleStreamEx of(Collection<Double> collection) {
        return seq(collection.stream().mapToDouble(Double::doubleValue));
    }
716566
public double getDouble(final String key) {
		final String value = getProperty(key);
		if (value == null) {
			throw new NumberFormatException("Couldn't parse property to double.");
		}
		return Double.parseDouble(value);
	}
1193535
public static final long getLong(InputStream is) throws IOException
   {
      byte[] data = new byte[8];
      is.read(data);
      return getLong(data, 0);
   }
180012
public static Double readDouble(String value, Double defaultValue) {
		if (!StringUtils.hasText(value)) return defaultValue;
		
		return Double.valueOf(value);
	}
137336
@Override
  public double getValueDouble(long[] args, long n) throws IOException {
    double value = 0;
    if (args != null) {
      for (long a : args) {
        value += a;
      }
    }
    return value;
  }
810517
public static final double getDouble(String value)
   {
      return (value == null || value.length() == 0 ? 0 : Double.parseDouble(value));
   }
759402
public static double asDouble( Object o ) {
    if( o == null ) return Double.NaN;
    if( o instanceof Integer ) return ((Integer)o);
    if( o instanceof Long ) return ((Long)o);
    if( o instanceof Float ) return ((Float)o);
    if( o instanceof Double ) return ((Double)o);
    if( o instanceof Enum ) return ((Enum)o).ordinal();
    System.out.println("Do not know how to convert a "+o.getClass()+" to a double");
    throw H2O.fail();
  }
379675
public Double convertToDouble(String value) {
        Double result = null;
        if (value != null) {
            result = Double.valueOf(value);
        }
        return result;
    }
280588
@Override
	public DoubleStream getRealizationsStream() {
		if(isDeterministic()) {
			return DoubleStream.generate(new DoubleSupplier() {
				@Override
				public double getAsDouble() {
					return valueIfNonStochastic;
				}
			});
		}
		else {
			return IntStream.range(0,size()).mapToDouble(realizations).parallel();
		}
	}
1318354
public static Double[] asDoubleArray(List<Double> input) {
		Double[] result = new Double[input.size()];

		for (int i = 0; i < result.length; i++) {
			result[i] = input.get(i);
		}

		return result;
	}