CharacterEncoderImplementations__SingleByteEncoder.st
changeset 11997 b4a8b0240492
parent 8811 b2a78fe1d44f
child 12433 b8654ecbc50d
equal deleted inserted replaced
11996:3f018d0b8d45 11997:b4a8b0240492
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
       
    13 "{ Package: 'stx:libbasic' }"
    12 "{ Package: 'stx:libbasic' }"
    14 
    13 
    15 "{ NameSpace: CharacterEncoderImplementations }"
    14 "{ NameSpace: CharacterEncoderImplementations }"
    16 
    15 
    17 CharacterEncoder subclass:#SingleByteEncoder
    16 CharacterEncoder subclass:#SingleByteEncoder
    60 
    59 
    61 newString:size
    60 newString:size
    62     ^ String uninitializedNew:size
    61     ^ String uninitializedNew:size
    63 ! !
    62 ! !
    64 
    63 
       
    64 !SingleByteEncoder methodsFor:'queries'!
       
    65 
       
    66 characterSize:codePoint
       
    67 
       
    68     ^1
       
    69 
       
    70     "Created: / 15-06-2005 / 15:11:24 / janfrog"
       
    71 ! !
       
    72 
       
    73 !SingleByteEncoder methodsFor:'stream support'!
       
    74 
       
    75 readNext:charactersToRead charactersFrom:stream
       
    76 
       
    77     ^self decodeString:(stream next:charactersToRead)
       
    78 
       
    79     "Created: / 16-06-2005 / 11:45:52 / masca"
       
    80 !
       
    81 
       
    82 readNextCharacterFrom:aStream
       
    83 
       
    84     | c |
       
    85 
       
    86     c := aStream next
       
    87 
       
    88     ^ c isNil 
       
    89         ifTrue: [nil]
       
    90         ifFalse: [(self decode:c asInteger) asCharacter]
       
    91 
       
    92     "Created: / 14-06-2005 / 17:03:21 / janfrog"
       
    93     "Modified: / 15-06-2005 / 15:27:49 / janfrog"
       
    94     "Modified: / 20-06-2005 / 13:13:52 / masca"
       
    95 ! !
       
    96 
    65 !SingleByteEncoder class methodsFor:'documentation'!
    97 !SingleByteEncoder class methodsFor:'documentation'!
    66 
    98 
    67 version
    99 version
    68     ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__SingleByteEncoder.st,v 1.5 2005-03-31 18:13:33 cg Exp $'
   100     ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__SingleByteEncoder.st,v 1.6 2009-09-22 09:08:34 fm Exp $'
    69 ! !
   101 ! !