package org.asamk.signal.util;
+import org.whispersystems.signalservice.internal.util.Util;
+
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
return output.toString();
}
+ public static byte[] readFully(InputStream in) throws IOException {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ Util.copy(in, baos);
+ return baos.toByteArray();
+ }
+
public static void createPrivateDirectories(String directoryPath) throws IOException {
final File file = new File(directoryPath);
if (file.exists()) {