private ByteBuffer buffer(Message m[]) throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); for (int i = 0; i < m.length; i++) m[i].write(out); out.flush(); return ByteBuffer.wrap(out.toByteArray()); }
private ByteBuffer buffer(List ms) throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); for (Iterator i = ms.iterator(); i.hasNext(); ) ((Message) i.next()).write(out); out.flush(); return ByteBuffer.wrap(out.toByteArray()); }
private ByteBuffer buffer(Message m) throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); m.write(out); out.flush(); return ByteBuffer.wrap(out.toByteArray()); }