2013-02-15 4 views
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[]'.OutputStream write() 메서드 오류

무슨 문제 일 수 있습니까?

답변

1

write()OutputStream의 방법은 byte[] 객체가 아닌 Byte[]java.lang

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

의이보고는 받아 here