本文整理汇总了C#中org.xdrDecodeString方法的典型用法代码示例。如果您正苦于以下问题:C# org.xdrDecodeString方法的具体用法?C# org.xdrDecodeString怎么用?C# org.xdrDecodeString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org
的用法示例。
在下文中一共展示了org.xdrDecodeString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: xdrDecodeCredVerf
/// <summary>
/// Decodes -- that is: deserializes -- an ONC/RPC authentication object
/// (credential & verifier) on the server side.
/// </summary>
/// <remarks>
/// Decodes -- that is: deserializes -- an ONC/RPC authentication object
/// (credential & verifier) on the server side.
/// </remarks>
/// <exception cref="org.acplt.oncrpc.OncRpcException">if an ONC/RPC error occurs.</exception>
/// <exception cref="System.IO.IOException">if an I/O error occurs.</exception>
public sealed override void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream
xdr)
{
//
// Reset some part of the object's state...
//
shorthandVerf = null;
//
// Now pull off the object state of the XDR stream...
//
int realLen = xdr.xdrDecodeInt();
stamp = xdr.xdrDecodeInt();
machinename = xdr.xdrDecodeString();
uid = xdr.xdrDecodeInt();
gid = xdr.xdrDecodeInt();
gids = xdr.xdrDecodeIntVector();
//
// Make sure that the indicated length of the opaque data is kosher.
// If not, throw an exception, as there is something strange going on!
//
int len = 4 + ((machinename.Length + 7) & ~3) + 4 + 4 + (gids.Length * 4) + 4;
// length of stamp
// len string incl. len
// length of uid
// length of gid
// length of vector of gids incl. len
if (realLen != len)
{
if (realLen < len)
{
throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFERUNDERFLOW
));
}
else
{
throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_AUTHERROR
));
}
}
//
// We also need to decode the verifier. This must be of type
// AUTH_NONE too. For some obscure historical reasons, we have to
// deal with credentials and verifiers, although they belong together,
// according to Sun's specification.
//
if ((xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) || (
xdr.xdrDecodeInt() != 0))
{
throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus
.ONCRPC_AUTH_BADVERF));
}
}
示例2: xdrDecode
/// <summary>
/// Decodes -- that is: deserializes -- a XDR string from a XDR stream in
/// compliance to RFC 1832.
/// </summary>
/// <remarks>
/// Decodes -- that is: deserializes -- a XDR string from a XDR stream in
/// compliance to RFC 1832.
/// </remarks>
/// <exception cref="OncRpcException">if an ONC/RPC error occurs.</exception>
/// <exception cref="System.IO.IOException">if an I/O error occurs.</exception>
/// <exception cref="org.acplt.oncrpc.OncRpcException"></exception>
public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr)
{
value = xdr.xdrDecodeString();
}