Use i/o stream for serverbug

This commit is contained in:
M66B
2022-04-30 21:30:22 +02:00
parent 21b8264e3a
commit ce0334bd2a
2 changed files with 22 additions and 15 deletions

View File

@@ -117,6 +117,7 @@ import com.google.android.material.snackbar.Snackbar;
import org.openintents.openpgp.util.OpenPgpApi;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -2086,6 +2087,22 @@ public class Helper {
}
}
static class ByteArrayInOutStream extends ByteArrayOutputStream {
public ByteArrayInOutStream() {
super();
}
public ByteArrayInOutStream(int size) {
super(size);
}
public ByteArrayInputStream getInputStream() {
ByteArrayInputStream in = new ByteArrayInputStream(this.buf, 0, this.count);
this.buf = null;
return in;
}
}
// Cryptography
static String sha256(String data) throws NoSuchAlgorithmException {