Stream.st
changeset 20376 c94223e280ae
parent 20366 5c949545fd4a
child 20398 8cb53f870d39
child 20502 34abf78c8d00
equal deleted inserted replaced
20375:6269450051d8 20376:c94223e280ae
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 1989 by Claus Gittinger
     2  COPYRIGHT (c) 1989 by Claus Gittinger
     5 	      All Rights Reserved
     3 	      All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
  2025         self nextPutUtf16Bytes:(aString at:idx) MSB:msb.
  2023         self nextPutUtf16Bytes:(aString at:idx) MSB:msb.
  2026     ].
  2024     ].
  2027 
  2025 
  2028     "
  2026     "
  2029         (#[] writeStream
  2027         (#[] writeStream
  2030             nextPutAllUtf16Bytes:'BÄxxx' MSB:true;
  2028             nextPutAllUtf16Bytes:'BÄxxx' MSB:true;
  2031             nextPutUtf16:(Character codePoint:16r10CCCC) MSB:true;
  2029             nextPutUtf16:(Character codePoint:16r10CCCC) MSB:true;
  2032             contents)
  2030             contents)
  2033    "
  2031    "
  2034 !
  2032 !
  2035 
  2033 
  2443     ]].
  2441     ]].
  2444 
  2442 
  2445     "
  2443     "
  2446         ((WriteStream on:Unicode16String new)
  2444         ((WriteStream on:Unicode16String new)
  2447             nextPutUtf16:$B;
  2445             nextPutUtf16:$B;
  2448             nextPutUtf16:$Ä; 
  2446             nextPutUtf16:$Ä; 
  2449             nextPutUtf16:(Character codePoint:16r10CCCC)
  2447             nextPutUtf16:(Character codePoint:16r10CCCC)
  2450             yourself) contents
  2448             yourself) contents
  2451     "
  2449     "
  2452 !
  2450 !
  2453 
  2451 
  2478             ].
  2476             ].
  2479 
  2477 
  2480     "
  2478     "
  2481         (#[] writeStream
  2479         (#[] writeStream
  2482             nextPutUtf16:$B MSB:true;
  2480             nextPutUtf16:$B MSB:true;
  2483             nextPutUtf16:$Ä MSB:true;
  2481             nextPutUtf16:$Ä MSB:true;
  2484             nextPutUtf16:(Character codePoint:16r10CCCC) MSB:true;
  2482             nextPutUtf16:(Character codePoint:16r10CCCC) MSB:true;
  2485             contents)
  2483             contents)
  2486 
  2484 
  2487         (FileStream newTemporary
  2485         (FileStream newTemporary
  2488             nextPutUtf16:$B MSB:false;
  2486             nextPutUtf16:$B MSB:false;
  2489             nextPutUtf16:$Ä MSB:false;
  2487             nextPutUtf16:$Ä MSB:false;
  2490             nextPutUtf16:(Character codePoint:16r10CCCC) MSB:false;
  2488             nextPutUtf16:(Character codePoint:16r10CCCC) MSB:false;
  2491             reset;
  2489             reset;
  2492             binary;
  2490             binary;
  2493             contents)"
  2491             contents)"
  2494 !
  2492 !
  2549     EncodingError raiseWith:aCharacter errorString:'codePoint > 31bit in #nextPutUtf8:'.
  2547     EncodingError raiseWith:aCharacter errorString:'codePoint > 31bit in #nextPutUtf8:'.
  2550 
  2548 
  2551     "
  2549     "
  2552       (String streamContents:[:s|
  2550       (String streamContents:[:s|
  2553             s nextPutUtf8:$a.
  2551             s nextPutUtf8:$a.
  2554             s nextPutUtf8:$ü.
  2552             s nextPutUtf8:$ü.
  2555             s nextPutUtf8: (Character value:16r1fff).
  2553             s nextPutUtf8: (Character value:16r1fff).
  2556             s nextPutUtf8: (Character value:16rffff).
  2554             s nextPutUtf8: (Character value:16rffff).
  2557             s nextPutUtf8: (Character value:16r1ffffff).
  2555             s nextPutUtf8: (Character value:16r1ffffff).
  2558             s nextPutUtf8: (Character value:16r800).
  2556             s nextPutUtf8: (Character value:16r800).
  2559       ])
  2557       ])