static void readFully()

in src/main/java/com/spotify/sparkey/Util.java [240:251]


  static void readFully(InputStream inputStream, byte[] buf, int len) throws IOException {
    int pos = 0;
    int remaining = len;
    while (pos < len) {
      int read = inputStream.read(buf, pos, remaining);
      if (read == -1) {
        throw new EOFException();
      }
      pos += read;
      remaining -= read;
    }
  }