mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
parent
3f315df6c8
commit
23845eab47
6 changed files with 228 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
|||
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;
|
||||
|
@ -35,6 +38,12 @@ public class IOUtils {
|
|||
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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue