+ if (line_count != 0) {
+ try {
+ line = new String(line_bytes, 0, line_count, "UTF-8");
+ } catch (UnsupportedEncodingException ue) {
+ line = "";
+ for (int i = 0; i < line_count; i++)
+ line = line + line_bytes[i];
+ }
+ if (line.startsWith("VERSION") || line.startsWith("CRC")) {
+ for (int e = 0; e < monitors.size(); e++) {
+ LinkedBlockingQueue<AltosLine> q = monitors.get(e);
+ q.put(new AltosLine (line));
+ }
+ } else {
+// System.out.printf("GOT: %s\n", line);
+ reply_queue.put(new AltosLine (line));
+ }
+ line_count = 0;