Here you can find the source of inputStreamReadBytesUntil(int endInd, InputStream is, byte[] buf, int off)
public static void inputStreamReadBytesUntil(int endInd, InputStream is, byte[] buf, int off) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStream; public class Main { public static void inputStreamReadBytesUntil(int endInd, InputStream is, byte[] buf, int off) throws IOException { while (off < endInd) off += is.read(buf, off, endInd - off); }//from ww w. j ava2s .c om }