mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-09-23 06:39:04 +00:00
parent
b9008f0b66
commit
e60b80effc
@ -10,7 +10,6 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.io.StringWriter;
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
import java.net.StandardProtocolFamily;
|
import java.net.StandardProtocolFamily;
|
||||||
@ -46,13 +45,7 @@ public class IOUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String readAll(InputStream in, Charset charset) throws IOException {
|
public static String readAll(InputStream in, Charset charset) throws IOException {
|
||||||
var output = new StringWriter();
|
return new String(in.readAllBytes(), charset);
|
||||||
var buffer = new byte[4096];
|
|
||||||
int n;
|
|
||||||
while (-1 != (n = in.read(buffer))) {
|
|
||||||
output.write(new String(buffer, 0, n, charset));
|
|
||||||
}
|
|
||||||
return output.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createPrivateDirectories(File file) throws IOException {
|
public static void createPrivateDirectories(File file) throws IOException {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user