catch ( DecoderException e )
{
fail();
}
KrbSafeBody body = container.getKrbSafeBody();
String time = "20101119080043Z";
HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" ) );
assertTrue( Arrays.equals( new byte[]
{ 0, 1 }, body.getUserData() ) );
assertEquals( time, body.getTimestamp().getDate() );
assertEquals( 1, body.getUsec() );
assertEquals( 1, body.getSeqNumber() );
assertEquals( ad, body.getSenderAddress() );
assertEquals( ad, body.getRecipientAddress() );
int computedLen = body.computeLength();
assertEquals( streamLen, computedLen );
try
{
ByteBuffer bb = ByteBuffer.allocate( computedLen );
body.encode( bb );
String encoded = Strings.dumpBytes( bb.array() );
assertEquals( decoded, encoded );
}
catch ( EncoderException e )