314315316317318319320321
public void writeDouble(double value) throws OpenwireException { initializeWriting(); try { this.dataOut.writeDouble(value); } catch (IOException ioe) { throw new OpenwireException(ioe); } }
323324325326327328329330
public void writeUTF(String value) throws OpenwireException { initializeWriting(); try { this.dataOut.writeUTF(value); } catch (IOException ioe) { throw new OpenwireException(ioe); } }
332333334335336337338339
public void writeBytes(byte[] value) throws OpenwireException { initializeWriting(); try { this.dataOut.write(value); } catch (IOException ioe) { throw new OpenwireException(ioe); } }
341342343344345346347348
public void writeBytes(byte[] value, int offset, int length) throws OpenwireException { initializeWriting(); try { this.dataOut.write(value, offset, length); } catch (IOException ioe) { throw new OpenwireException(ioe); } }
371372373374375376377378
} else if (value instanceof String) { writeUTF(value.toString()); } else if (value instanceof byte[]) { writeBytes((byte[])value); } else { throw new OpenwireException("Cannot write non-primitive type:" + value.getClass()); } }
394395396397398399400401402403404
// keep track of the real length of the content if // we are compressed. try { os.write(new byte[4]); } catch (IOException e) { throw new OpenwireException(e); } length = 0; compressed = true; final Deflater deflater = new Deflater(Deflater.BEST_SPEED); os = new FilterOutputStream(new DeflaterOutputStream(os, deflater)) {
428429430431432433434435
} } protected void checkWriteOnlyBody() throws OpenwireException { if (!readOnlyBody) { throw new OpenwireException("Message body is write-only"); } }
448449450451452453454455456457458
try { DataInputStream dis = new DataInputStream(is); length = dis.readInt(); dis.close(); } catch (IOException e) { throw new OpenwireException(e); } is = new InflaterInputStream(is); } else { length = data.getLength(); }
818283848586878889
try { acknowledgeCallback.execute(); } catch (OpenwireException e) { throw e; } catch (Throwable e) { throw new OpenwireException(e); } } }
138139140141142143144145
MessageId id = null; try { id = new MessageId(producerId, producerSequenceId); this.setMessageId(id); } catch (Throwable e) { throw new OpenwireException("Invalid message id '" + id + "', reason: " + e.getMessage(), e); } }