Here you can find the source of nextBytes(BufferedInputStream in)
public static byte[] nextBytes(BufferedInputStream in) throws IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedInputStream; import java.io.IOException; public class Main { public static byte[] nextBytes(BufferedInputStream in) throws IOException { byte[] bytes = new byte[100]; int num;//ww w . ja v a 2 s.com num = in.read(bytes); if (num == -1) return null; if (num < 100) { byte[] result = new byte[num]; for (int index = 0; index < num; index++) result[index] = bytes[index]; } return bytes; } }