@@ -926,11 +926,7 @@ public void GetBuffer(byte[] buffer)
926926 public void GetBuffer ( int offset , byte [ ] buffer , int length )
927927 {
928928 ThrowIfAlreadyDisposed ( ) ;
929-
930- var tagSize = GetSize ( ) ;
931- var temp = new byte [ tagSize ] ;
932-
933- var result = ( Status ) _native . plc_tag_get_raw_bytes ( nativeTagHandle , offset , temp , length ) ;
929+ var result = ( Status ) _native . plc_tag_get_raw_bytes ( nativeTagHandle , offset , buffer , length ) ;
934930 ThrowIfStatusNotOk ( result ) ;
935931 }
936932
@@ -939,12 +935,10 @@ public void SetBuffer(byte[] buffer)
939935 SetBuffer ( 0 , buffer , buffer . Length ) ;
940936 }
941937
942- public void SetBuffer ( int offset , byte [ ] buffer , int length )
938+ public void SetBuffer ( int start_offset , byte [ ] buffer , int length )
943939 {
944940 ThrowIfAlreadyDisposed ( ) ;
945-
946- GetNativeValueAndThrowOnNegativeResult ( _native . plc_tag_set_size , buffer . Length ) ;
947- var result = ( Status ) _native . plc_tag_set_raw_bytes ( nativeTagHandle , 0 , buffer , buffer . Length ) ;
941+ var result = ( Status ) _native . plc_tag_set_raw_bytes ( nativeTagHandle , start_offset , buffer , length ) ;
948942 ThrowIfStatusNotOk ( result ) ;
949943 }
950944
0 commit comments