mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-15 18:10:23 +00:00
Remove net module
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package com.topjohnwu.magisk.net;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
class BadRequest extends Request {
|
||||
|
||||
private IOException ex;
|
||||
|
||||
BadRequest(IOException e) { super(null); ex = e; }
|
||||
|
||||
@Override
|
||||
public Request addHeaders(String key, String value) { return this; }
|
||||
|
||||
@Override
|
||||
public Result<InputStream> execForInputStream() { fail(); return new Result<>(); }
|
||||
|
||||
@Override
|
||||
public void getAsFile(File out, ResponseListener<File> rs) { fail(); }
|
||||
|
||||
@Override
|
||||
public void execForFile(File out) { fail(); }
|
||||
|
||||
@Override
|
||||
public void getAsString(ResponseListener<String> rs) { fail(); }
|
||||
|
||||
@Override
|
||||
public Result<String> execForString() { fail(); return new Result<>(); }
|
||||
|
||||
@Override
|
||||
public void getAsJSONObject(ResponseListener<JSONObject> rs) { fail(); }
|
||||
|
||||
@Override
|
||||
public Result<JSONObject> execForJSONObject() { fail(); return new Result<>(); }
|
||||
|
||||
@Override
|
||||
public void getAsJSONArray(ResponseListener<JSONArray> rs) { fail(); }
|
||||
|
||||
@Override
|
||||
public Result<JSONArray> execForJSONArray() { fail(); return new Result<>(); }
|
||||
|
||||
private void fail() {
|
||||
if (err != null)
|
||||
err.onError(null, ex);
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
package com.topjohnwu.magisk.net;
|
||||
|
||||
import java.net.HttpURLConnection;
|
||||
|
||||
public interface ErrorHandler {
|
||||
void onError(HttpURLConnection conn, Exception e);
|
||||
}
|
@@ -0,0 +1,60 @@
|
||||
package com.topjohnwu.magisk.net;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
|
||||
public class Networking {
|
||||
|
||||
private static final int READ_TIMEOUT = 15000;
|
||||
private static final int CONNECT_TIMEOUT = 15000;
|
||||
static Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
|
||||
private static Request request(String url, String method) {
|
||||
try {
|
||||
HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
|
||||
conn.setRequestMethod(method);
|
||||
conn.setReadTimeout(READ_TIMEOUT);
|
||||
conn.setConnectTimeout(CONNECT_TIMEOUT);
|
||||
return new Request(conn);
|
||||
} catch (IOException e) {
|
||||
return new BadRequest(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Request get(String url) {
|
||||
return request(url, "GET");
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
try {
|
||||
// Try installing new SSL provider from Google Play Service
|
||||
Context gms = context.createPackageContext("com.google.android.gms",
|
||||
Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY);
|
||||
gms.getClassLoader()
|
||||
.loadClass("com.google.android.gms.common.security.ProviderInstallerImpl")
|
||||
.getMethod("insertProvider", Context.class)
|
||||
.invoke(null, gms);
|
||||
} catch (Exception e) {
|
||||
// Failed to update SSL provider, use NoSSLv3SocketFactory on SDK < 21
|
||||
if (Build.VERSION.SDK_INT < 21)
|
||||
HttpsURLConnection.setDefaultSSLSocketFactory(new NoSSLv3SocketFactory());
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean checkNetworkStatus(Context context) {
|
||||
ConnectivityManager manager = (ConnectivityManager)
|
||||
context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo networkInfo = manager.getActiveNetworkInfo();
|
||||
return networkInfo != null && networkInfo.isConnected();
|
||||
}
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
package com.topjohnwu.magisk.net;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLSocket;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
|
||||
class NoSSLv3SocketFactory extends SSLSocketFactory {
|
||||
|
||||
private final static SSLSocketFactory base = HttpsURLConnection.getDefaultSSLSocketFactory();
|
||||
|
||||
@Override
|
||||
public String[] getDefaultCipherSuites() {
|
||||
return base.getDefaultCipherSuites();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getSupportedCipherSuites() {
|
||||
return base.getSupportedCipherSuites();
|
||||
}
|
||||
|
||||
private Socket createSafeSocket(Socket socket) {
|
||||
if (socket instanceof SSLSocket)
|
||||
return new SSLSocketWrapper((SSLSocket) socket) {
|
||||
@Override
|
||||
public void setEnabledProtocols(String[] protocols) {
|
||||
List<String> proto = new ArrayList<>(Arrays.asList(getSupportedProtocols()));
|
||||
proto.remove("SSLv3");
|
||||
super.setEnabledProtocols(proto.toArray(new String[0]));
|
||||
}
|
||||
};
|
||||
return socket;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException {
|
||||
return createSafeSocket(base.createSocket(s, host, port, autoClose));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket() throws IOException {
|
||||
return createSafeSocket(base.createSocket());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(String host, int port) throws IOException {
|
||||
return createSafeSocket(base.createSocket(host, port));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException {
|
||||
return createSafeSocket(base.createSocket(host, port, localHost, localPort));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(InetAddress host, int port) throws IOException {
|
||||
return createSafeSocket(base.createSocket(host, port));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
|
||||
return createSafeSocket(base.createSocket(address, port, localAddress, localPort));
|
||||
}
|
||||
}
|
215
shared/src/main/java/com/topjohnwu/magisk/net/Request.java
Normal file
215
shared/src/main/java/com/topjohnwu/magisk/net/Request.java
Normal file
@@ -0,0 +1,215 @@
|
||||
package com.topjohnwu.magisk.net;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FilterInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.util.Scanner;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
public class Request implements Closeable {
|
||||
private HttpURLConnection conn;
|
||||
private Executor executor = null;
|
||||
private int code = -1;
|
||||
|
||||
ErrorHandler err = null;
|
||||
|
||||
private interface Requestor<T> {
|
||||
T request() throws Exception;
|
||||
}
|
||||
|
||||
public class Result<T> {
|
||||
T result;
|
||||
|
||||
public T getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return code >= 200 && code <= 299;
|
||||
}
|
||||
|
||||
public HttpURLConnection getConnection() {
|
||||
return conn;
|
||||
}
|
||||
}
|
||||
|
||||
Request(HttpURLConnection c) {
|
||||
conn = c;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
conn.disconnect();
|
||||
}
|
||||
|
||||
public Request addHeaders(String key, String value) {
|
||||
conn.setRequestProperty(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Request setErrorHandler(ErrorHandler handler) {
|
||||
err = handler;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Request setExecutor(Executor e) {
|
||||
executor = e;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result<Void> connect() {
|
||||
try {
|
||||
connect0();
|
||||
} catch (IOException e) {
|
||||
if (err != null)
|
||||
err.onError(conn, e);
|
||||
}
|
||||
return new Result<>();
|
||||
}
|
||||
|
||||
public Result<InputStream> execForInputStream() {
|
||||
return exec(this::getInputStream);
|
||||
}
|
||||
|
||||
public void getAsFile(File out, ResponseListener<File> rs) {
|
||||
submit(() -> dlFile(out), rs);
|
||||
}
|
||||
|
||||
public void execForFile(File out) {
|
||||
exec(() -> dlFile(out));
|
||||
}
|
||||
|
||||
public void getAsBytes(ResponseListener<byte[]> rs) {
|
||||
submit(this::dlBytes, rs);
|
||||
}
|
||||
|
||||
public Result<byte[]> execForBytes() {
|
||||
return exec(this::dlBytes);
|
||||
}
|
||||
|
||||
public void getAsString(ResponseListener<String> rs) {
|
||||
submit(this::dlString, rs);
|
||||
}
|
||||
|
||||
public Result<String> execForString() {
|
||||
return exec(this::dlString);
|
||||
}
|
||||
|
||||
public void getAsJSONObject(ResponseListener<JSONObject> rs) {
|
||||
submit(this::dlJSONObject, rs);
|
||||
}
|
||||
|
||||
public Result<JSONObject> execForJSONObject() {
|
||||
return exec(this::dlJSONObject);
|
||||
}
|
||||
|
||||
public void getAsJSONArray(ResponseListener<JSONArray> rs) {
|
||||
submit(this::dlJSONArray, rs);
|
||||
}
|
||||
|
||||
public Result<JSONArray> execForJSONArray() {
|
||||
return exec(this::dlJSONArray);
|
||||
}
|
||||
|
||||
private void connect0() throws IOException {
|
||||
conn.connect();
|
||||
code = conn.getResponseCode();
|
||||
}
|
||||
|
||||
private <T> Result<T> exec(Requestor<T> req) {
|
||||
Result<T> res = new Result<>();
|
||||
try {
|
||||
res.result = req.request();
|
||||
} catch (Exception e) {
|
||||
if (err != null)
|
||||
err.onError(conn, e);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private <T> void submit(Requestor<T> req, ResponseListener<T> rs) {
|
||||
AsyncTask.THREAD_POOL_EXECUTOR.execute(() -> {
|
||||
try {
|
||||
T t = req.request();
|
||||
Runnable cb = () -> rs.onResponse(t);
|
||||
if (executor == null)
|
||||
Networking.mainHandler.post(cb);
|
||||
else
|
||||
executor.execute(cb);
|
||||
} catch (Exception e) {
|
||||
if (err != null)
|
||||
err.onError(conn, e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private BufferedInputStream getInputStream() throws IOException {
|
||||
connect0();
|
||||
InputStream in = new FilterInputStream(conn.getInputStream()) {
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
super.close();
|
||||
conn.disconnect();
|
||||
}
|
||||
};
|
||||
return new BufferedInputStream(in);
|
||||
}
|
||||
|
||||
private String dlString() throws IOException {
|
||||
try (Scanner s = new Scanner(getInputStream(), "UTF-8")) {
|
||||
s.useDelimiter("\\A");
|
||||
return s.next();
|
||||
}
|
||||
}
|
||||
|
||||
private JSONObject dlJSONObject() throws IOException, JSONException {
|
||||
return new JSONObject(dlString());
|
||||
}
|
||||
|
||||
private JSONArray dlJSONArray() throws IOException, JSONException {
|
||||
return new JSONArray(dlString());
|
||||
}
|
||||
|
||||
private File dlFile(File f) throws IOException {
|
||||
try (InputStream in = getInputStream();
|
||||
OutputStream out = new BufferedOutputStream(new FileOutputStream(f))) {
|
||||
int len;
|
||||
byte[] buf = new byte[4096];
|
||||
while ((len = in.read(buf)) != -1) {
|
||||
out.write(buf, 0, len);
|
||||
}
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
private byte[] dlBytes() throws IOException {
|
||||
int len = conn.getContentLength();
|
||||
len = len > 0 ? len : 32;
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream(len);
|
||||
try (InputStream in = getInputStream()) {
|
||||
byte[] buf = new byte[4096];
|
||||
while ((len = in.read(buf)) != -1) {
|
||||
out.write(buf, 0, len);
|
||||
}
|
||||
}
|
||||
return out.toByteArray();
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.topjohnwu.magisk.net;
|
||||
|
||||
public interface ResponseListener<T> {
|
||||
void onResponse(T response);
|
||||
}
|
@@ -0,0 +1,333 @@
|
||||
package com.topjohnwu.magisk.net;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.InetAddress;
|
||||
import java.net.SocketAddress;
|
||||
import java.net.SocketException;
|
||||
import java.nio.channels.SocketChannel;
|
||||
|
||||
import javax.net.ssl.HandshakeCompletedListener;
|
||||
import javax.net.ssl.SSLParameters;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.SSLSocket;
|
||||
|
||||
class SSLSocketWrapper extends SSLSocket {
|
||||
|
||||
private SSLSocket mBase;
|
||||
|
||||
SSLSocketWrapper(SSLSocket socket) {
|
||||
mBase = socket;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getSupportedCipherSuites() {
|
||||
return mBase.getSupportedCipherSuites();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getEnabledCipherSuites() {
|
||||
return mBase.getEnabledCipherSuites();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnabledCipherSuites(String[] suites) {
|
||||
mBase.setEnabledCipherSuites(suites);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getSupportedProtocols() {
|
||||
return mBase.getSupportedProtocols();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getEnabledProtocols() {
|
||||
return mBase.getEnabledProtocols();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnabledProtocols(String[] protocols) {
|
||||
mBase.setEnabledProtocols(protocols);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SSLSession getSession() {
|
||||
return mBase.getSession();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SSLSession getHandshakeSession() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addHandshakeCompletedListener(HandshakeCompletedListener listener) {
|
||||
mBase.addHandshakeCompletedListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeHandshakeCompletedListener(HandshakeCompletedListener listener) {
|
||||
mBase.removeHandshakeCompletedListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startHandshake() throws IOException {
|
||||
mBase.startHandshake();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUseClientMode(boolean mode) {
|
||||
mBase.setUseClientMode(mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getUseClientMode() {
|
||||
return mBase.getUseClientMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNeedClientAuth(boolean need) {
|
||||
mBase.setNeedClientAuth(need);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getNeedClientAuth() {
|
||||
return mBase.getNeedClientAuth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWantClientAuth(boolean want) {
|
||||
mBase.setWantClientAuth(want);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getWantClientAuth() {
|
||||
return mBase.getWantClientAuth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnableSessionCreation(boolean flag) {
|
||||
mBase.setEnableSessionCreation(flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getEnableSessionCreation() {
|
||||
return mBase.getEnableSessionCreation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SSLParameters getSSLParameters() {
|
||||
return mBase.getSSLParameters();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSSLParameters(SSLParameters params) {
|
||||
mBase.setSSLParameters(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return mBase.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connect(SocketAddress endpoint) throws IOException {
|
||||
mBase.connect(endpoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connect(SocketAddress endpoint, int timeout) throws IOException {
|
||||
mBase.connect(endpoint, timeout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind(SocketAddress bindpoint) throws IOException {
|
||||
mBase.bind(bindpoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetAddress getInetAddress() {
|
||||
return mBase.getInetAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetAddress getLocalAddress() {
|
||||
return mBase.getLocalAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPort() {
|
||||
return mBase.getPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLocalPort() {
|
||||
return mBase.getLocalPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SocketAddress getRemoteSocketAddress() {
|
||||
return mBase.getRemoteSocketAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SocketAddress getLocalSocketAddress() {
|
||||
return mBase.getLocalSocketAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SocketChannel getChannel() {
|
||||
return mBase.getChannel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return mBase.getInputStream();
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutputStream getOutputStream() throws IOException {
|
||||
return mBase.getOutputStream();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTcpNoDelay(boolean on) throws SocketException {
|
||||
mBase.setTcpNoDelay(on);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getTcpNoDelay() throws SocketException {
|
||||
return mBase.getTcpNoDelay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSoLinger(boolean on, int linger) throws SocketException {
|
||||
mBase.setSoLinger(on, linger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSoLinger() throws SocketException {
|
||||
return mBase.getSoLinger();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUrgentData(int data) throws IOException {
|
||||
mBase.sendUrgentData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOOBInline(boolean on) throws SocketException {
|
||||
mBase.setOOBInline(on);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOOBInline() throws SocketException {
|
||||
return mBase.getOOBInline();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSoTimeout(int timeout) throws SocketException {
|
||||
mBase.setSoTimeout(timeout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSoTimeout() throws SocketException {
|
||||
return mBase.getSoTimeout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSendBufferSize(int size) throws SocketException {
|
||||
mBase.setSendBufferSize(size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSendBufferSize() throws SocketException {
|
||||
return mBase.getSendBufferSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReceiveBufferSize(int size) throws SocketException {
|
||||
mBase.setReceiveBufferSize(size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getReceiveBufferSize() throws SocketException {
|
||||
return mBase.getReceiveBufferSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setKeepAlive(boolean on) throws SocketException {
|
||||
mBase.setKeepAlive(on);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getKeepAlive() throws SocketException {
|
||||
return mBase.getKeepAlive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficClass(int tc) throws SocketException {
|
||||
mBase.setTrafficClass(tc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTrafficClass() throws SocketException {
|
||||
return mBase.getTrafficClass();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReuseAddress(boolean on) throws SocketException {
|
||||
mBase.setReuseAddress(on);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getReuseAddress() throws SocketException {
|
||||
return mBase.getReuseAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
mBase.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdownInput() throws IOException {
|
||||
mBase.shutdownInput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdownOutput() throws IOException {
|
||||
mBase.shutdownOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnected() {
|
||||
return mBase.isConnected();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBound() {
|
||||
return mBase.isBound();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClosed() {
|
||||
return mBase.isClosed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInputShutdown() {
|
||||
return mBase.isInputShutdown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOutputShutdown() {
|
||||
return mBase.isOutputShutdown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) {
|
||||
mBase.setPerformancePreferences(connectionTime, latency, bandwidth);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user