304305306307308309310311
public void writeFloat(float value) throws OpenwireException { initializeWriting(); try { this.dataOut.writeFloat(value); } catch (IOException ioe) { throw new OpenwireException(ioe); } }
313314315316317318319320
public void writeDouble(double value) throws OpenwireException { initializeWriting(); try { this.dataOut.writeDouble(value); } catch (IOException ioe) { throw new OpenwireException(ioe); } }
322323324325326327328329
public void writeUTF(String value) throws OpenwireException { initializeWriting(); try { this.dataOut.writeUTF(value); } catch (IOException ioe) { throw new OpenwireException(ioe); } }
331332333334335336337338
public void writeBytes(byte[] value) throws OpenwireException { initializeWriting(); try { this.dataOut.write(value); } catch (IOException ioe) { throw new OpenwireException(ioe); } }
340341342343344345346347
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); } }
370371372373374375376377
} 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()); } }
393394395396397398399400401402403
// 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)) {
427428429430431432433434
} } protected void checkWriteOnlyBody() throws OpenwireException { if (!readOnlyBody) { throw new OpenwireException("Message body is write-only"); } }
447448449450451452453454455456457
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(); }
103104105106107108109110111112
public boolean readBoolean() throws OpenwireException { initializeReading(); try { return this.dataIn.readBoolean(); } catch (EOFException e) { throw new OpenwireException(e); } catch (IOException e) { throw new OpenwireException(e); } }