(InputStream is, Charset charset)
| 3088 | } |
| 3089 | |
| 3090 | public static String readLine(InputStream is, Charset charset) throws IOException { |
| 3091 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); |
| 3092 | int b = is.read(); |
| 3093 | if (b < 0) |
| 3094 | return null; |
| 3095 | while (b >= 0 && b != '\n') { |
| 3096 | bos.write(b); |
| 3097 | b = is.read(); |
| 3098 | } |
| 3099 | return new String(bos.toByteArray(), charset); |
| 3100 | } |
| 3101 | |
| 3102 | static void copy(File src, File dst) throws IOException { |
| 3103 | try (InputStream is = new FileInputStream(src)) { |