5 FileStream classMethod!
6 primOpen: fileName mode: anInteger
7 <primitive: 'FileStream_open'>
10 FileStream classMethod!
11 open: fileName mode: aSymbol
19 ifFalse: [self error: 'mode not supported']].
21 fd := self primOpen: fileName mode: mode.
22 ^ self basicNew on: fd!
25 primRead: fd count: anInteger
26 <primitive: 'FileStream_read'>
30 primWrite: fd byte: anInteger
31 <primitive: 'FileStream_write'>
35 primWrite: fd byteArray: aByteArray
36 <primitive: 'FileStream_write'>
41 <primitive: 'FileStream_close'>
46 "Read the next byte from the receiver"
47 ^ self primRead: fdesc count: 1!
51 "Read the next anInteger bytes from the receiver"
52 ^ self primRead: fdesc count: anInteger!
56 "write anInteger to the receiver."
57 ^ self primWrite: fdesc byteArray: (ByteArray with: anInteger)!
60 nextPutAll: aByteArray
61 ^ self primWrite: fdesc byteArray: aByteArray!
66 ^ self primClose: fdesc!