ts.addToken(new Text(serviceAddress), delegationToken);
ts.writeTokenStorageToStream(out);
byte[] tokenData = new byte[out.getLength()];
System.arraycopy(out.getData(), 0, tokenData, 0, tokenData.length);
return new ThriftDelegationToken(ByteBuffer.wrap(tokenData));
}