summaryrefslogtreecommitdiffstats
path: root/vespajlib
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2018-01-11 16:09:29 +0100
committerJon Bratseth <bratseth@yahoo-inc.com>2018-01-11 16:09:29 +0100
commit125bdaf97ebc63c5c6892ce4311418f0568908ce (patch)
treebac16eb938092892dec00483fc2503ba881da8c9 /vespajlib
parentad378e79897bfa229ddd84365f211889b1703671 (diff)
Complete support for TF constants as files (deactivated)
Diffstat (limited to 'vespajlib')
-rw-r--r--vespajlib/src/main/java/com/yahoo/io/IOUtils.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/io/IOUtils.java b/vespajlib/src/main/java/com/yahoo/io/IOUtils.java
index febe02cb33e..010a99e4ce1 100644
--- a/vespajlib/src/main/java/com/yahoo/io/IOUtils.java
+++ b/vespajlib/src/main/java/com/yahoo/io/IOUtils.java
@@ -426,6 +426,16 @@ public abstract class IOUtils {
}
}
+ /** Writes the given content to the file (replacing any existing content) */
+ public static void writeFile(File file, byte[] content) throws UncheckedIOException {
+ try (FileOutputStream out = new FileOutputStream(file)) {
+ out.write(content);
+ }
+ catch (IOException e) {
+ throw new UncheckedIOException(e);
+ }
+ }
+
/**
* Writes the given string to the file
*/