コード例 #1
0
 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());
 }
コード例 #2
0
 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());
 }
コード例 #3
0
 private ByteBuffer buffer(Message m) throws Exception {
   ByteArrayOutputStream out = new ByteArrayOutputStream();
   m.write(out);
   out.flush();
   return ByteBuffer.wrap(out.toByteArray());
 }