}
public static byte[] readBytes(InputStream in) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
copyInputStream(in, baos);
return baos.toByteArray();
}
public static void writeText(File path, String text) throws IOException {
writeText(path, text, "UTF-8");
}