Returns a sequential unordered {@code IntStreamEx} of given length which
elements are equal to supplied value.

@param value the constant value
@param length the length of the stream
@return a new {@code IntStreamEx}
@since 0.1.2
2983
public static IntStreamEx constant(int value, long length) {
        return of(new ConstSpliterator.OfInt(value, length, false));
    }
1142795
public static InputStreamResource buildInputStreamResourceFrom(final String value, final String description) {
        val reader = new StringReader(value);
        val is = new ReaderInputStream(reader, StandardCharsets.UTF_8);
        return new InputStreamResource(is, description);
    }
116148
public static BasicVector constant(int length, double value) {
        double[] array = new double[length];
        Arrays.fill(array, value);

        return new BasicVector(array);
    }
1140597
public static Stream<Integer> box(final int[] integers) {
        return new FixedSizeStream<>(integers.length, new Func1<Integer, Integer>() {
            @Override
            public Integer call(Integer index) {
                return integers[index];
            }
        });
    }
267141
public static SaneWord forInt(int value) {
    ByteArrayOutputStream byteStream = new ByteArrayOutputStream(SIZE_IN_BYTES);
    DataOutputStream stream = new DataOutputStream(byteStream);
    try {
      stream.writeInt(value);
    } catch (IOException e) {
      throw new IllegalArgumentException(e);
    }
    return new SaneWord(byteStream.toByteArray());
  }
403970
public JsonWriter value(@NonNull Iterable<?> value) throws IOException {
      Preconditions.checkArgument(inArray() || writeStack.peek() == JsonTokenType.NAME,
                                  "Expecting an array or a name, but found " + writeStack.peek());
      popIf(JsonTokenType.NAME);
      beginArray();
      for (Object o : value) {
         value(o);
      }
      endArray();
      return this;
   }
214084
public static <T> StreamEx<T> ofReversed(T[] array) {
        int size = array.length;
        return IntStreamEx.ofIndices(array).mapToObj(idx -> array[size - idx - 1]);
    }
352599
public static <T> Stream<T> streamOf( Optional<T> value)
    {
    return value.map( Stream::of).orElse( Stream.empty());
    }
910400
public static <T> T eq(T value) {
        reportMatcher(new Equals(value));
        if (value == null)
            return null;
        return (T) Primitives.defaultValue(value.getClass());
    }
702943
@Override
    public int readElementAsIntArray(int[] value, int from, int length) throws XMLStreamException
    {
        return readElementAsArray(_decoderFactory().getIntArrayDecoder(value, from, length));
    }
579208
public static <T> Stream<T> of(final T value) {
        return new Stream<T>() {
            @Override
            public Iterator<T> iterator() {
                return new ReadOnlyIterator<T>() {

                    boolean has = true;

                    @Override
                    public boolean hasNext() {
                        return has;
                    }

                    @Override
                    public T next() {
                        has = false;
                        return value;
                    }
                };
            }
        };
    }
1213637
@Override
    public StreamT<W,T> intersperse(final T value) {

        return (StreamT<W,T>) FoldableTransformerSeq.super.intersperse(value);
    }
214404
private static byte[] streamToBytes(InputStream in, int length) throws IOException {
        byte[] bytes = new byte[length];
        int count;
        int pos = 0;
        while (pos < length && ((count = in.read(bytes, pos, length - pos)) != -1)) {
            pos += count;
        }
        if (pos != length) {
            throw new IOException("Expected " + length + " bytes, read " + pos + " bytes");
        }
        return bytes;
    }
383246
public static float sortableIntToFloat(int value)
    {
        value = value ^ (value >> 31) & Integer.MAX_VALUE;
        return Float.intBitsToFloat(value);
    }
81595
public static Integer getAsInteger(Object value) {
		Integer result = null;

		try {
			if (value instanceof String) {
				result = Integer.valueOf((String) value);
			} else if (value instanceof Number) {
				result = ((Number) value).intValue();
			} else {
				result = null;
			}
		} catch (Exception e) {
			result = null;
		}

		return result == null ? 0 : result;
	}
995429
public static LongStreamEx of(Long[] array) {
        return seq(Arrays.stream(array).mapToLong(Long::longValue));
    }
964247
public Node<T> getNext(int value) {
    	if (value == last.value) return null;
    	if (value == root.value) {
    		if (root.right == null) return null;
    		Node<T> n = root.right;
    		while (n.left != null) n = n.left;
    		return n;
    	}
    	if (value > root.value) {
    		if (root.right == null) return null;
    		return getNext(root.right, value);
    	}
    	if (root.left == null) return null;
    	return getNext(root, root.left, value);
    }