int writeAsciiBytes ( byte [ ] buffer , long bytesToWrite ) throws IOException { if ( commPort != null && commPort . isOpen ( ) ) { int cnt = 0 ; for ( int i = 0 ; i < bytesToWrite ; i ++ ) { if ( writeAsciiByte ( buffer [ i ] ) != 2 ) { return cnt ; } cnt ++ ; } return cnt ; } else { throw new IOException ( "Comm port is not valid or not open" ) ; } }
Writes an array of bytes out as a stream of ascii characters