(InputStream in)
| 47 | |
| 48 | |
| 49 | public static byte[] readBytes(InputStream in) |
| 50 | throws IOException |
| 51 | { |
| 52 | BufferedInputStream bufin = new BufferedInputStream(in); |
| 53 | int buffSize = 1024; |
| 54 | ByteArrayOutputStream out = new ByteArrayOutputStream(buffSize); |
| 55 | byte[] temp = new byte[buffSize]; |
| 56 | int size = 0; |
| 57 | while ((size = bufin.read(temp)) != -1) { |
| 58 | out.write(temp, 0, size); |
| 59 | } |
| 60 | bufin.close(); |
| 61 | |
| 62 | byte[] content = out.toByteArray(); |
| 63 | |
| 64 | return content; |
| 65 | } |
| 66 | |
| 67 | public static void do_exec(String[] cmd) |
| 68 | throws Exception |