diff --git a/src/XML-Parser/XMLPharoFileReferenceReadStreamFactory.class.st b/src/XML-Parser/XMLPharoFileReferenceReadStreamFactory.class.st new file mode 100644 index 00000000..a43dd985 --- /dev/null +++ b/src/XML-Parser/XMLPharoFileReferenceReadStreamFactory.class.st @@ -0,0 +1,20 @@ +" +A StandardFileStream read stream factory. This stream is preferred for Squeak/Pharo because it does no decoding and returns byte characters so XMLParser can do its own decoding. +" +Class { + #name : 'XMLPharoFileReferenceReadStreamFactory', + #superclass : 'XMLFileReadStreamFactory', + #category : 'XML-Parser-Files', + #package : 'XML-Parser', + #tag : 'Files' +} + +{ #category : 'basic' } +XMLPharoFileReferenceReadStreamFactory class >> basicOnPath: aPathString [ + ^ aPathString asFileReference ensureCreateFile binaryReadStream +] + +{ #category : 'testing' } +XMLPharoFileReferenceReadStreamFactory class >> isSupportedImplementation [ + ^ XMLClassFinder hasClassNamed: #ZnBufferedReadStream +] diff --git a/src/XML-Parser/XMLPharoFileReferenceWriteStreamFactory.class.st b/src/XML-Parser/XMLPharoFileReferenceWriteStreamFactory.class.st new file mode 100644 index 00000000..f980c263 --- /dev/null +++ b/src/XML-Parser/XMLPharoFileReferenceWriteStreamFactory.class.st @@ -0,0 +1,20 @@ +" +A StandardFileStream write stream factory. This stream is preferred for Pharo/Squeak because it does no encoding and accepts byte characters so XMLParser can do its own encoding. +" +Class { + #name : 'XMLPharoFileReferenceWriteStreamFactory', + #superclass : 'XMLFileWriteStreamFactory', + #category : 'XML-Parser-Files', + #package : 'XML-Parser', + #tag : 'Files' +} + +{ #category : 'basic' } +XMLPharoFileReferenceWriteStreamFactory class >> basicOnPath: aPathString [ + ^ aPathString asFileReference ensureCreateFile binaryWriteStream +] + +{ #category : 'testing' } +XMLPharoFileReferenceWriteStreamFactory class >> isSupportedImplementation [ + ^ XMLClassFinder hasClassNamed: #ZnBufferedWriteStream +]