public static BytesInput from(InputStream in, int bytes) {
    return new StreamBytesInput(in, bytes);
  }
@Test
  public void testFromInputStream() throws IOException {
    byte[] data = new byte[1000];
    RANDOM.nextBytes(data);
    byte[] input = new byte[data.length + 10];
    RANDOM.nextBytes(input);
    System.arraycopy(data, 0, input, 0, data.length);
    Supplier<BytesInput> factory = () -> BytesInput.from(new ByteArrayInputStream(input), 1000);

    validate(data, factory);
  }