Opc.Ua.XmlEncoder.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 (BeginField(fieldName, value == null, true))
            {
                // check the length.
                if (m_context.MaxByteStringLength > 0 && m_context.MaxByteStringLength < value.Length)
                {
                    throw new ServiceResultException(StatusCodes.BadEncodingLimitsExceeded);
                }

                m_writer.WriteValue(Convert.ToBase64String(value));
                EndField(fieldName);
            }
        }