final byte[] bytes = "hello world".getBytes();
ByteBuffer writeonlybuffer = rwChannel.map(FileChannel.MapMode.READ_WRITE, 0, bytes.length);
writeonlybuffer.put(bytes);
writeonlybuffer.compact();
}
private File writeToFile2(InputStream archive, String name) throws IOException {
final File file = File.createTempFile("deploy", "-" + name);
final FileOutputStream outputStream = new FileOutputStream(file);