EXEを実行する。MACの場合はmonoで実行する @return 標準出力に表示されたデータ
(String... command)
| 193 | * @return 標準出力に表示されたデータ |
| 194 | */ |
| 195 | public static byte[] executeRuby(String... command) throws Exception { |
| 196 | |
| 197 | Process p = Runtime.getRuntime().exec(addRubyPath(command)); |
| 198 | InputStream in = p.getInputStream(); |
| 199 | ByteArrayOutputStream bout = new ByteArrayOutputStream(); |
| 200 | byte[] buffer = new byte[4096]; |
| 201 | int len = 0; |
| 202 | while ((len = in.read(buffer, 0, 4096)) > 0) { |
| 203 | |
| 204 | bout.write(buffer, 0, len); |
| 205 | } |
| 206 | return Base64.decodeBase64(bout.toByteArray()); |
| 207 | } |
| 208 | |
| 209 | public static byte[] readfile(String filename) throws Exception { |
| 210 | FileInputStream fis = new FileInputStream(filename); |
nothing calls this directly
no test coverage detected