本文整理汇总了Java中org.fdroid.fdroid.net.bluetooth.BluetoothConnection类的典型用法代码示例。如果您正苦于以下问题:Java BluetoothConnection类的具体用法?Java BluetoothConnection怎么用?Java BluetoothConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BluetoothConnection类属于org.fdroid.fdroid.net.bluetooth包,在下文中一共展示了BluetoothConnection类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: send
import org.fdroid.fdroid.net.bluetooth.BluetoothConnection; //导入依赖的package包/类
public void send(BluetoothConnection connection) throws IOException {
Utils.debugLog(TAG, "Sending Bluetooth HTTP-ish response...");
Writer output = new OutputStreamWriter(connection.getOutputStream());
output.write("HTTP(ish)/0.1 200 OK\n");
for (Map.Entry<String, String> entry : headers.entrySet()) {
output.write(entry.getKey());
output.write(": ");
output.write(entry.getValue());
output.write("\n");
}
output.write("\n");
output.flush();
if (contentStream != null) {
Utils.copy(contentStream, connection.getOutputStream());
}
output.flush();
}
示例2: Request
import org.fdroid.fdroid.net.bluetooth.BluetoothConnection; //导入依赖的package包/类
private Request(String method, String path, BluetoothConnection connection) {
this.method = method;
this.path = path;
this.connection = connection;
output = new OutputStreamWriter(connection.getOutputStream());
input = connection.getInputStream();
}
示例3: createHEAD
import org.fdroid.fdroid.net.bluetooth.BluetoothConnection; //导入依赖的package包/类
public static Request createHEAD(String path, BluetoothConnection connection) {
return new Request(Methods.HEAD, path, connection);
}
示例4: createGET
import org.fdroid.fdroid.net.bluetooth.BluetoothConnection; //导入依赖的package包/类
public static Request createGET(String path, BluetoothConnection connection) {
return new Request(Methods.GET, path, connection);
}
示例5: listenForRequest
import org.fdroid.fdroid.net.bluetooth.BluetoothConnection; //导入依赖的package包/类
/**
* This is a blocking method, which will wait until a full Request is received.
*/
public static Request listenForRequest(BluetoothConnection connection) throws IOException {
Request request = new Request("", "", connection);
return request.listen() ? request : null;
}