Apache.NMS.ActiveMQ.OpenWire.BooleanStream.Unmarshal C# (CSharp) Méthode

Unmarshal() public méthode

public Unmarshal ( BinaryReader dataIn ) : void
dataIn System.IO.BinaryReader
Résultat void
        public void Unmarshal(BinaryReader dataIn)
        {
            arrayLimit = (short)(dataIn.ReadByte() & 0xFF);
            if ( arrayLimit == 0xC0 ) {
                arrayLimit = (short)(dataIn.ReadByte() & 0xFF);
            } else if( arrayLimit == 0x80 ) {
                arrayLimit = dataIn.ReadInt16();
            }
            if( data.Length < arrayLimit ) {
                data = new byte[arrayLimit];
            }

            dataIn.Read(data, 0, arrayLimit);
            Clear();
        }

Usage Example

Exemple #1
0
        public Object Unmarshal(BinaryReader dis)
        {
            // lets ignore the size of the packet
            if (!sizePrefixDisabled)
            {
                dis.ReadInt32();
            }

            // first byte is the type of the packet
            byte dataType = dis.ReadByte();

            if (dataType != NULL_TYPE)
            {
                BaseDataStreamMarshaller dsm = GetDataStreamMarshallerForType(dataType);

                Object data = dsm.CreateObject();

                if (tightEncodingEnabled)
                {
                    BooleanStream bs = new BooleanStream();
                    bs.Unmarshal(dis);
                    dsm.TightUnmarshal(this, data, dis, bs);
                    return(data);
                }
                else
                {
                    dsm.LooseUnmarshal(this, data, dis);
                    return(data);
                }
            }

            return(null);
        }
All Usage Examples Of Apache.NMS.ActiveMQ.OpenWire.BooleanStream::Unmarshal