private void updateAvailable() { buffer = new ArrayList<Byte>(); try { while (serialStreams.available() > 0) buffer.add((byte) serialStreams.read()); } catch (IOException e) { e.printStackTrace(); } }
public synchronized void send(byte[] bytes) throws IOException { for (byte b : bytes) serialStreams.write(b); }