org.acplt.oncrpc.XdrEncodingStream.xdrEncodeByteFixedVector C# (CSharp) Method

xdrEncodeByteFixedVector() public method

Encodes (aka "serializes") a vector of bytes, which is nothing more than a series of octets (or 8 bits wide bytes), each packed into its very own 4 bytes (XDR int).
Encodes (aka "serializes") a vector of bytes, which is nothing more than a series of octets (or 8 bits wide bytes), each packed into its very own 4 bytes (XDR int).
if an ONC/RPC error occurs. if an I/O error occurs. /// if the length of the vector does not /// match the specified length. ///
public xdrEncodeByteFixedVector ( Array value, int length ) : void
value Array Byte vector to encode.
length int /// of vector to write. This parameter is used as a sanity /// check. ///
return void
		public void xdrEncodeByteFixedVector(byte[] value, int length)
		{
			if (value.Length != length)
			{
				throw (new System.ArgumentException("array size does not match protocol specification"
					));
			}
			if (length != 0)
			{
				//
				// For speed reasons, we do sign extension here, but the higher bits
				// will be removed again when deserializing.
				//
				for (int i = 0; i < length; ++i)
				{
					xdrEncodeInt((int)value[i]);
				}
			}
		}