Here you can find the source of readBytes(InputStream inputStream, int numberOfBytes)
private static byte[] readBytes(InputStream inputStream, int numberOfBytes) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStream; public class Main { private static byte[] readBytes(InputStream inputStream, int numberOfBytes) throws IOException { byte[] readBytes = new byte[numberOfBytes]; inputStream.read(readBytes);/* www . ja v a 2 s. c o m*/ return readBytes; } }