예제 #1
0
 public virtual MarshallingBuffer CheckBlockAlignment(MarshallingContext context,
                                                      MarshallingBuffer precedingBuffer, IntByRef precedingLength)
 {
     _lastOffSet = Offset();
     if (DoBlockAlign())
     {
         precedingBuffer.BlockAlign(context, precedingLength.value);
     }
     if (precedingBuffer != null)
     {
         precedingLength.value += precedingBuffer.Length();
     }
     precedingBuffer = this;
     if (_children != null)
     {
         IEnumerator i = new Iterator4Impl(_children);
         while (i.MoveNext())
         {
             precedingBuffer = ((MarshallingBuffer)i.Current).CheckBlockAlignment(context, precedingBuffer
                                                                                  , precedingLength);
         }
     }
     return(precedingBuffer);
 }
예제 #2
0
		public virtual MarshallingBuffer CheckBlockAlignment(MarshallingContext context, 
			MarshallingBuffer precedingBuffer, IntByRef precedingLength)
		{
			_lastOffSet = Offset();
			if (DoBlockAlign())
			{
				precedingBuffer.BlockAlign(context, precedingLength.value);
			}
			if (precedingBuffer != null)
			{
				precedingLength.value += precedingBuffer.Length();
			}
			precedingBuffer = this;
			if (_children != null)
			{
				IEnumerator i = new Iterator4Impl(_children);
				while (i.MoveNext())
				{
					precedingBuffer = ((MarshallingBuffer)i.Current).CheckBlockAlignment(context, precedingBuffer
						, precedingLength);
				}
			}
			return precedingBuffer;
		}
예제 #3
0
		public virtual int RequiredLength(MarshallingBuffer buffer, bool align)
		{
			if (!align)
			{
				return buffer.Length();
			}
			return Container().BlockConverter().BlockAlignedBytes(buffer.Length());
		}