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 に答える