Add support for uploading stickers.

Closes #256
This commit is contained in:
Signal Stickers 2019-12-29 16:23:51 -05:00 committed by AsamK
parent 3f315df6c8
commit 23845eab47
6 changed files with 228 additions and 0 deletions

View file

@ -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()) {