private byte[] getBytes(short[] array) { try { ByteArrayOutputStream bytestream = new ByteArrayOutputStream(); DataOutputStream datastream = new DataOutputStream(bytestream); for (short n : array) { datastream.writeShort(n); } datastream.flush(); return bytestream.toByteArray(); } catch (IOException ioe) { Logging.logger().finest(ioe.getMessage()); } return null; }
public void run() { if (Thread.currentThread().isInterrupted()) return; // the task was cancelled because it's a duplicate or for some other reason try { this.placemark.retrieveModel(this.address); } catch (IOException e) { String message = Logging.getMessage("generic.ExceptionWhileReading", e.getMessage()); Logging.logger().warning(message); } catch (XMLStreamException e) { String message = Logging.getMessage("generic.ExceptionAttemptingToParseXml", e.getMessage()); Logging.logger().warning(message); } }