replyHeader.xdrDecode(receivingXdr);
try { replyHeader.xdrDecode(receivingXdr); } catch ( OncRpcException e ) {         receivingXdr.endDecoding(); throw(e); }
    public synchronized void call(int procedureNumber, int versionNumber,                                  XdrAble params, XdrAble result)        throws OncRpcException {    Refresh:        for ( int refreshesLeft = 1; refreshesLeft >= 0;              --refreshesLeft ) {            //            // First, build the ONC/RPC call header. Then put the sending            // stream into a known state and encode the parameters to be            // sent. Finally tell the encoding stream to send all its data            // to the server. Then wait for an answer, receive it and decode            // it. So that's the bottom line of what we do right here.            //            nextXid();            OncRpcClientCallMessage callHeader =                new OncRpcClientCallMessage(xid,                                            program,                                            versionNumber, procedureNumber,                                            auth);            OncRpcClientReplyMessage replyHeader =                new OncRpcClientReplyMessage(auth);            //            // Send call message to server. If we receive an IOException,            // then we'll throw the appropriate ONC/RPC (client) exception.            // Note that we use a connected stream, so we don't need to            // specify a destination when beginning serialization.            //            try {                socket.setSoTimeout(transmissionTimeout);                sendingXdr.beginEncoding(null, 0);                callHeader.xdrEncode(sendingXdr);                params.xdrEncode(sendingXdr);                if ( timeout != 0 ) {                    sendingXdr.endEncoding();                } else {                    sendingXdr.endEncoding(false);                }            } catch ( IOException e ) {                throw(new OncRpcException(OncRpcException.RPC_CANTSEND,                                          e.getLocalizedMessage()));            }            //            // Receive reply message from server -- at least try to do so...            // In case of batched calls we don't need no stinkin' answer, so            // we can do other, more interesting things.            //            if ( timeout == 0 ) {                return;            }            try {                //                // Keep receiving until we get the matching reply.                //                while ( true ) {                    socket.setSoTimeout(timeout);                    receivingXdr.beginDecoding();                    socket.setSoTimeout(transmissionTimeout);                    //                    // First, pull off the reply message header of the                    // XDR stream. In case we also received a verifier                    // from the server and this verifier was invalid, broken                    // or tampered with, we will get an                    // OncRpcAuthenticationException right here, which will                    // propagate up to the caller. If the server reported                    // an authentication problem itself, then this will                    // be handled as any other rejected ONC/RPC call.                    //                    replyHeader.xdrDecode(receivingXdr);                    //                    // Only deserialize the result, if the reply matches the                    // call. Otherwise skip this record.                    //                    if ( replyHeader.messageId == callHeader.messageId ) {                        break;                    }                    receivingXdr.endDecoding();                }                //                // Make sure that the call was accepted. In case of unsuccessful                // calls, throw an exception, if it's not an authentication                // exception. In that case try to refresh the credential first.                //                if ( !replyHeader.successfullyAccepted() ) {                    receivingXdr.endDecoding();                    //                    // Check whether there was an authentication                    // problem. In this case first try to refresh the                    // credentials.                    //                    if ( (refreshesLeft > 0)                         && (replyHeader.replyStatus                             == OncRpcReplyStatus.ONCRPC_MSG_DENIED)                         && (replyHeader.rejectStatus                             == OncRpcRejectStatus.ONCRPC_AUTH_ERROR)                         && (auth != null)                         && auth.canRefreshCred() ) {                        continue Refresh;                    }                    //                    // Nope. No chance. This gets tough.                    //                    throw(replyHeader.newException());                }                result.xdrDecode(receivingXdr);                //                // Free pending resources of buffer and exit the call loop,                // returning the reply to the caller through the result                // object.                //                receivingXdr.endDecoding();                return;            } catch ( InterruptedIOException e ) {                //                // In case our time run out, we throw an exception.                //                throw(new OncRpcTimeoutException());            } catch ( IOException e ) {                //                // Argh. Trouble with the transport. Seems like we can't                // receive data. Gosh. Go away!                //                throw(new OncRpcException(OncRpcException.RPC_CANTRECV,                                          e.getLocalizedMessage()));            }        } // for ( refreshesLeft )    }