BotUtils { static byte[] getBytesFromInputStream(InputStream is) throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); byte[] buffer = new byte[0xFFFF]; for (int len = is.read(buffer); len != -1; len = is.read(buffer)) { os.write(buffer, 0, len); } return os.toByteArray(); } private  BotUtils(); static Update parseUpdate(String update); static Update parseUpdate(Reader reader); static R fromJson(String jsonString, Class<R> resClass); static String toJson(Object obj);  }
@Test public void getBytesFromInputStream() throws IOException { byte[] src = {1, 2, 3, 4}; byte[] bytes = BotUtils.getBytesFromInputStream(new ByteArrayInputStream(src)); assertArrayEquals(bytes, src); }