WriteBuffer() 개인적인 메소드

private WriteBuffer ( TargetMemoryAccess target, byte data ) : void
target TargetMemoryAccess
data byte
리턴 void
예제 #1
0
        internal virtual void SetObject(TargetMemoryAccess target, TargetLocation location,
                                        TargetObject obj)
        {
            if (obj == null)
            {
                if (IsByRef)
                {
                    location.WriteAddress(target, TargetAddress.Null);
                    return;
                }

                throw new InvalidOperationException();
            }

            if (IsByRef)
            {
                if (obj.Type.IsByRef)
                {
                    location.WriteAddress(target, obj.Location.GetAddress(target));
                    return;
                }

                throw new InvalidOperationException();
            }

            if (!HasFixedSize || !obj.Type.HasFixedSize)
            {
                throw new InvalidOperationException();
            }
            if (Size != obj.Type.Size)
            {
                throw new InvalidOperationException();
            }

            byte[] contents = obj.Location.ReadBuffer(target, obj.Type.Size);
            location.WriteBuffer(target, contents);
        }
예제 #2
0
        internal virtual void SetObject(TargetMemoryAccess target, TargetLocation location,
						 TargetObject obj)
        {
            if (obj == null) {
                if (IsByRef) {
                    location.WriteAddress (target, TargetAddress.Null);
                    return;
                }

                throw new InvalidOperationException ();
            }

            if (IsByRef) {
                if (obj.Type.IsByRef) {
                    location.WriteAddress (target, obj.Location.GetAddress (target));
                    return;
                }

                throw new InvalidOperationException ();
            }

            if (!HasFixedSize || !obj.Type.HasFixedSize)
                throw new InvalidOperationException ();
            if (Size != obj.Type.Size)
                throw new InvalidOperationException ();

            byte[] contents = obj.Location.ReadBuffer (target, obj.Type.Size);
            location.WriteBuffer (target, contents);
        }