forked from SeasideSt/Grease
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGRNullCodec.class.st
More file actions
68 lines (55 loc) · 1.39 KB
/
GRNullCodec.class.st
File metadata and controls
68 lines (55 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
"
The null codec always returns the original streams. It assumes that the outside world uses the same encoding as the inside world. This is highly efficient as no transformation is applied to the data, but has its drawbacks.
"
Class {
#name : 'GRNullCodec',
#superclass : 'GRCodec',
#category : 'Grease-Core-Text',
#package : 'Grease-Core',
#tag : 'Text'
}
{ #category : 'private' }
GRNullCodec class >> basicForEncoding: aString [
^ self new
]
{ #category : 'accessing' }
GRNullCodec class >> codecName [
^ '(none)'
]
{ #category : 'accessing' }
GRNullCodec class >> codecs [
^ Array with: self new
]
{ #category : 'testing' }
GRNullCodec class >> supportsEncoding: aString [
^ aString isNil
]
{ #category : 'convenience' }
GRNullCodec >> decode: aString [
"Overridden for efficiency."
^ aString
]
{ #category : 'conversion' }
GRNullCodec >> decoderFor: aReadStream [
"wrap to avoid String vs ByteArray issues"
^ GRNullCodecStream on: aReadStream
]
{ #category : 'convenience' }
GRNullCodec >> encode: aString [
"Overridden for efficiency."
^ aString
]
{ #category : 'conversion' }
GRNullCodec >> encoderFor: aWriteStream [
"wrap to avoid String vs ByteArray issues"
^ GRNullCodecStream on: aWriteStream
]
{ #category : 'accessing' }
GRNullCodec >> name [
^ GRNullCodec codecName
]
{ #category : 'accessing' }
GRNullCodec >> url [
"The selfish method. Let's do it with ourselves."
^ self
]