Apache.NMS.ActiveMQ.OpenWire.OpenWireFormat.TightMarshalNestedObject1 C# (CSharp) Method

TightMarshalNestedObject1() public method

public TightMarshalNestedObject1 ( DataStructure o, BooleanStream bs ) : int
o DataStructure
bs BooleanStream
return int
        public int TightMarshalNestedObject1(DataStructure o, BooleanStream bs)
        {
            bs.WriteBoolean(o != null);
            if(null == o)
            {
                return 0;
            }

            if(o.IsMarshallAware())
            {
                MarshallAware ma = (MarshallAware) o;
                byte[] sequence = ma.GetMarshalledForm(this);
                bs.WriteBoolean(sequence != null);
                if(sequence != null)
                {
                    return 1 + sequence.Length;
                }
            }

            byte type = o.GetDataStructureType();
            if(type == 0)
            {
                throw new IOException("No valid data structure type for: " + o + " of type: " + o.GetType());
            }

            BaseDataStreamMarshaller dsm = GetDataStreamMarshallerForType(type);

            Tracer.Debug("Marshalling type: " + type + " with structure: " + o);
            return 1 + dsm.TightMarshal1(this, o, bs);
        }

Usage Example

 protected virtual int TightMarshalNestedObject1(
     OpenWireFormat wireFormat,
     DataStructure o,
     BooleanStream bs)
 {
     return(wireFormat.TightMarshalNestedObject1(o, bs));
 }
All Usage Examples Of Apache.NMS.ActiveMQ.OpenWire.OpenWireFormat::TightMarshalNestedObject1