0
public class Streams extends Thread {

    private BluetoothSocket clientSocket;
    private InputStream input;
    private OutputStream output;

    public void Streams(BluetoothSocket s)
    {
        clientSocket = s;
        try {
            input = s.getInputStream();
            output = s.getOutputStream();
            Log.d("RTR","Got Socket Streams");
        }catch (Exception e){
            Log.d("RTR","Unable to get Socket IO Streams");
        }

    }
    public void run()
    {
       //create an infinite loop for reading data.This method runs in seperate Thread

    }

    public void write(Byte[] bytes)
    {
        //output.write(bytes);
    }

}

我在最后一条评论行出现错误output.write(bytes)Cannot resolve method java.lang.Byte[]'.

可能是什么问题?

4

1 回答 1

1

write()OutputStream接受不属于的byte[]对象的方法Byte[]java.lang

 public void write(byte[] bytes)
 {
        //output.write(bytes);
 }

看看这里

于 2013-02-15T08:38:26.970 回答