UninterpretedBytes.st
changeset 12951 6856ade56f18
parent 12769 435668a20ddd
child 13575 44a3b3c29795
equal deleted inserted replaced
12950:5a6dbcf1a274 12951:6856ade56f18
  2430     idx := bytes indexOf:0.
  2430     idx := bytes indexOf:0.
  2431     idx ~~ 0 ifTrue:[ bytes := bytes copyTo:idx-1 ].
  2431     idx ~~ 0 ifTrue:[ bytes := bytes copyTo:idx-1 ].
  2432     ^ bytes asString
  2432     ^ bytes asString
  2433 
  2433 
  2434     "Created: 9.9.1996 / 15:28:34 / cg"
  2434     "Created: 9.9.1996 / 15:28:34 / cg"
       
  2435 ! !
       
  2436 
       
  2437 !UninterpretedBytes methodsFor:'converting'!
       
  2438 
       
  2439 asExternalBytes
       
  2440     |sz bytes|
       
  2441 
       
  2442     sz := self size.
       
  2443     bytes := ExternalBytes unprotectedNew:sz.
       
  2444     bytes replaceBytesFrom:1 to:sz with:self startingAt:1.
       
  2445     ^ bytes
       
  2446 
       
  2447     "
       
  2448       #[1 2 3 4 5 6 7] asExternalBytes
       
  2449       'Hello World' asExternalBytes
       
  2450     "
  2435 ! !
  2451 ! !
  2436 
  2452 
  2437 !UninterpretedBytes methodsFor:'filling & replacing'!
  2453 !UninterpretedBytes methodsFor:'filling & replacing'!
  2438 
  2454 
  2439 replaceBytesFrom:start to:stop with:aCollection startingAt:repStart
  2455 replaceBytesFrom:start to:stop with:aCollection startingAt:repStart
  2884 ! !
  2900 ! !
  2885 
  2901 
  2886 !UninterpretedBytes class methodsFor:'documentation'!
  2902 !UninterpretedBytes class methodsFor:'documentation'!
  2887 
  2903 
  2888 version
  2904 version
  2889     ^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.76 2010-03-08 07:42:57 stefan Exp $'
  2905     ^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.77 2010-07-19 13:58:34 stefan Exp $'
  2890 !
  2906 !
  2891 
  2907 
  2892 version_CVS
  2908 version_CVS
  2893     ^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.76 2010-03-08 07:42:57 stefan Exp $'
  2909     ^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.77 2010-07-19 13:58:34 stefan Exp $'
  2894 ! !
  2910 ! !