return buffer.toByteArray();
}
public static AuthorizationContext deserialiaze(byte[] data) {
DataInput input = new DataInputImpl(data);
String name = input.readVUTF();
String tenant = input.readVUTF();
Set<String> roles = new HashSet<String>();
int roleCnt = input.readVInt();
for (int i = 0; i < roleCnt; i++) {
roles.add(input.readVUTF());
}
return new AuthorizationContext(name, tenant, roles);
}