CharacterEncoderImplementations__ISO10646_to_UTF16LE.st
author Stefan Vogel <sv@exept.de>
Thu, 16 Apr 2015 18:28:45 +0200
branchexpecco_2_7_5
changeset 18220 361e98951d47
parent 14171 d0b0a6918da7
child 18011 deb0c3355881
child 19216 d1325e650883
permissions -rw-r--r--
Add methods for backward compatibilty with older sublasses

"
 COPYRIGHT (c) 2005 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libbasic' }"

"{ NameSpace: CharacterEncoderImplementations }"

ISO10646_to_UTF16BE subclass:#ISO10646_to_UTF16LE
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Collections-Text-Encodings'
!

!ISO10646_to_UTF16LE class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2005 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    encodes/decodes UTF16 LittleEndian (little-end-first)
"
!

examples
"
  Encoding (unicode to utf16LE)
     ISO10646_to_UTF16LE encodeString:'hello'.


  Decoding (utf16LE to unicode):
     |t|

     t := ISO10646_to_UTF16LE encodeString:''.
     ISO10646_to_UTF16LE decodeString:t.

  Decoding (utf16LE-Bytes to unicode):
     |bytes|

     bytes := #[ 16r40 0 16r41 0 16r42 0 16r43 0 16r44 0 ].
     ISO10646_to_UTF16LE decodeString:bytes.
"
! !

!ISO10646_to_UTF16LE methodsFor:'encoding & decoding'!

decode:codePoint
    ^ codePoint swapBytes
!

encode:codePoint
    ^ codePoint swapBytes
! !

!ISO10646_to_UTF16LE methodsFor:'private'!

nextPutTwoByteValue:anInteger to:aStream
    aStream nextPutShort:anInteger MSB:false
!

nextTwoByteValueFrom:aStream
    ^ aStream nextUnsignedShortMSB:false
! !

!ISO10646_to_UTF16LE methodsFor:'queries'!

nameOfEncoding
    ^ #utf16le
! !

!ISO10646_to_UTF16LE class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO10646_to_UTF16LE.st,v 1.3 2012-07-10 07:55:26 stefan Exp $'
! !