'From Cuis 1.0 of 28 November 2009 [latest update: #337] on 15 December 2009 at 10:26:57 am'!
!classDefinition: #FileWriteError category: #'System-Exceptions Kernel'!
FileStreamException subclass: #FileWriteError
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'System-Exceptions Kernel'!
!classDefinition: #SocketPrimitiveFailed category: #'Network-Kernel'!
NetworkError subclass: #SocketPrimitiveFailed
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Network-Kernel'!

!Socket methodsFor: 'primitives' stamp: 'jmv 12/14/2009 11:02'!
primSocketReceiveDataAvailable: socketID
	"Return true if data may be available for reading from the current socket."

	<primitive: 'primitiveSocketReceiveDataAvailable' module: 'SocketPlugin'>
	SocketPrimitiveFailed signal! !


!StandardFileStream methodsFor: 'primitives' stamp: 'jmv 12/14/2009 13:57'!
primWrite: id from: stringOrByteArray startingAt: startIndex count: count
	"Write count bytes onto this file from the given string or byte array starting at the given index. Answer the number of bytes written."

	<primitive: 'primitiveFileWrite' module: 'FilePlugin'>
	(FileWriteError fileName: name)
		signal: (self closed
			ifTrue: [ 'File ', name, ' is closed' ]
			ifFalse: [ 'File ', name, 'write failed' ])! !

