protected static void writeAuthToken(DataOutput out, AuthToken tok) throws Exception { out.writeByte(tok == null? 0 : 1); if(tok == null) return; short id=ClassConfigurator.getMagicNumber(tok.getClass()); out.writeShort(id); if(id < 0) { String classname=tok.getClass().getName(); out.writeUTF(classname); } tok.writeTo(out); }
protected static void writeAuthToken(DataOutput out, AuthToken tok) throws Exception { out.writeByte(tok == null? 0 : 1); if(tok == null) return; short id=ClassConfigurator.getMagicNumber(tok.getClass()); out.writeShort(id); if(id < 0) { String classname=tok.getClass().getName(); out.writeUTF(classname); } tok.writeTo(out); }
public static void writeAuthToken(AuthToken token, DataOutputStream out) throws IOException{ Util.writeString(token.getName(), out); token.writeTo(out); }