src/com/btwiz/library/BTSocket.java
public void writeAsync(final byte[] buffer, final int offset, 
			final int count, final IWriteListener writeListener) { 
		synchronized (writeThreadLock) {
			if (writeThread==null) {
				writeThread = Executors.newSingleThreadExecutor();
				Log.e("BTSocket", "writeThread created");
			}
		}		
		writeThread.execute(new Runnable() {				
			@Override
			public void run() {
				try {
					write(buffer, offset, count);
					writeListener.onSuccess();
				} 
				catch (IOException e) {
					e.printStackTrace();
					Log.e("BTSocket", "write error: " + e);
					if (writeListener != null) {
						writeListener.onError(e);
					}
				}
			}
		});
	}
/**
	 * Asynchronously write count bytes from buffer starting at offset.
	 * Activate writeListener at error/complete
	 */
Asynchronously write count bytes from buffer starting at offset.
Activate writeListener at error/complete
Asynchronously write count bytes from buffer starting at offset . Activate writeListener at error / complete
public void writeAsync(final byte[] buffer, final int offset, 
			final int count, final IWriteListener writeListener) { 
		synchronized (writeThreadLock) {
			if (writeThread==null) {
				writeThread = Executors.newSingleThreadExecutor();
				Log.e("BTSocket", "writeThread created");
			}
		}		
		writeThread.execute(new Runnable() {				
			@Override
			public void run() {
				try {
					write(buffer, offset, count);
					writeListener.onSuccess();
				} 
				catch (IOException e) {
					e.printStackTrace();
					Log.e("BTSocket", "write error: " + e);
					if (writeListener != null) {
						writeListener.onError(e);
					}
				}
			}
		});
	}
public void writeAsync ( final byte [ ] buffer , final int offset , final int count , final IWriteListener writeListener ) { synchronized ( writeThreadLock ) { if ( writeThread == null ) { writeThread = Executors . newSingleThreadExecutor ( ) ; Log . e ( "BTSocket" , "writeThread created" ) ; } } writeThread . execute ( new Runnable ( ) { @ Override public void run ( ) { try { write ( buffer , offset , count ) ; writeListener . onSuccess ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; Log . e ( "BTSocket" , "write error: " + e ) ; if ( writeListener != null ) { writeListener . onError ( e ) ; } } } } ) ; }
Asynchronously write count bytes from buffer starting at offset.
Asynchronously write count bytes from buffer starting at offset .