Opc.Ua.JsonEncoder.WriteByteString C# (CSharp) Method

WriteByteString() public method

Writes a byte string to the stream.
public WriteByteString ( string fieldName, byte value ) : void
fieldName string
value byte
return void
        public void WriteByteString(string fieldName, byte[] value)
        {
            if (value == null || value.Length == 0)
            {
                WriteSimpleField(fieldName, null, false);
                return;
            }
        
            // check the length.
            if (m_context.MaxByteStringLength > 0 && m_context.MaxByteStringLength < value.Length)
            {
                throw new ServiceResultException(StatusCodes.BadEncodingLimitsExceeded);
            }

            WriteSimpleField(fieldName, Convert.ToBase64String(value), true);
        }