writeShort(-1); return;
writeShort(-1); return;
public Buffer objectToBuffer(Object obj) throws Exception { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(msg_size + 100); boolean is_mc=obj instanceof MethodCall; out.writeBoolean(is_mc); if(!is_mc) Util.objectToStream(obj, out); else { MethodCall mc=(MethodCall)obj; out.writeShort(mc.getId()); Object[] args=mc.getArgs(); int num_args=args == null? 0 : args.length; out.writeShort(num_args); for(int i=0; i < num_args; i++) Util.objectToStream(args[i], out); } return out.getBuffer(); }
public Buffer objectToBuffer(Object obj) throws Exception { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(msg_size + 100); boolean is_mc=obj instanceof MethodCall; out.writeBoolean(is_mc); if(!is_mc) Util.objectToStream(obj, out); else { MethodCall mc=(MethodCall)obj; out.writeShort(mc.getId()); Object[] args=mc.getArgs(); int num_args=args == null? 0 : args.length; out.writeShort(num_args); for(int i=0; i < num_args; i++) Util.objectToStream(args[i], out); } return out.getBuffer(); }
public Buffer objectToBuffer(Object obj) throws Exception { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(msg_size + 100); boolean is_mc=obj instanceof MethodCall; out.writeBoolean(is_mc); if(!is_mc) Util.objectToStream(obj, out); else { MethodCall mc=(MethodCall)obj; out.writeShort(mc.getId()); Object[] args=mc.getArgs(); int num_args=args == null? 0 : args.length; out.writeShort(num_args); for(int i=0; i < num_args; i++) Util.objectToStream(args[i], out); } return out.getBuffer(); }
protected void sendLocalAddress(Address local_addr) throws Exception { try { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(); out.write(cookie, 0, cookie.length); out.writeShort(Version.version); out.writeShort(local_addr.size()); // address size local_addr.writeTo(out); ByteBuffer buf=out.getByteBuffer(); send(buf, false); updateLastAccessed(); } catch(Exception ex) { close(); throw ex; } }
protected void sendLocalAddress(Address local_addr) throws Exception { try { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(); out.write(cookie, 0, cookie.length); out.writeShort(Version.version); out.writeShort(local_addr.size()); // address size local_addr.writeTo(out); ByteBuffer buf=out.getByteBuffer(); send(buf, false); updateLastAccessed(); } catch(Exception ex) { close(); throw ex; } }
protected void sendLocalAddress(Address local_addr) throws Exception { try { ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(); out.write(cookie, 0, cookie.length); out.writeShort(Version.version); out.writeShort(local_addr.size()); // address size local_addr.writeTo(out); ByteBuffer buf=out.getByteBuffer(); send(buf, false); updateLastAccessed(); } catch(Exception ex) { close(); throw ex; } }
dos.writeShort(Version.version); // write the version if(msg.getDest() == null) flags+=(byte)2;
dos.writeShort(Version.version); // write the version if(msg.getDest() == null) flags+=(byte)2;
dos.writeShort(Version.version); // write the version if(msg.getDest() == null) flags+=(byte)2;
protected static Buffer marshal(final View view, final Digest digest) { try { final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512); out.writeShort(determineFlags(view, digest)); if(view != null) view.writeTo(out); if(digest != null) digest.writeTo(out, writeAddresses(view, digest)); return out.getBuffer(); } catch(Exception ex) { return null; } }
protected static Buffer marshal(final View view, final Digest digest) { try { final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512); out.writeShort(determineFlags(view, digest)); if(view != null) view.writeTo(out); if(digest != null) digest.writeTo(out, writeAddresses(view, digest)); return out.getBuffer(); } catch(Exception ex) { return null; } }
protected static Buffer marshal(final View view, final Digest digest) { try { final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512); out.writeShort(determineFlags(view, digest)); if(view != null) view.writeTo(out); if(digest != null) digest.writeTo(out, writeAddresses(view, digest)); return out.getBuffer(); } catch(Exception ex) { return null; } }
protected Buffer writeMessage(final Message msg) throws Exception { dos.position(0); byte flags=0; dos.writeShort(Version.version); // write the version if(msg.getDest() == null) flags+=(byte)2; dos.writeByte(flags); msg.writeTo(dos); return new Buffer(dos.buffer(), 0, dos.position()); } }
protected Buffer writeMessage(final Message msg) throws Exception { dos.position(0); byte flags=0; dos.writeShort(Version.version); // write the version if(msg.getDest() == null) flags+=(byte)2; dos.writeByte(flags); msg.writeTo(dos); return new Buffer(dos.buffer(), 0, dos.position()); } }
protected Buffer writeMessage(final Message msg) throws Exception { dos.position(0); byte flags=0; dos.writeShort(Version.version); // write the version if(msg.getDest() == null) flags+=(byte)2; dos.writeByte(flags); msg.writeTo(dos); return new Buffer(dos.buffer(), 0, dos.position()); } }