class: Stream
authorClaus Gittinger <cg@exept.de>
Thu, 19 Mar 2015 22:44:52 +0100
changeset 17628 5acbf3c5af8c
parent 17627 adba1b4d01c9
child 17629 4df317a366b4
class: Stream added: #nextIEEEDoubleMSB: #nextIEEESingleMSB: #nextPutIEEEDouble:msb: #nextPutIEEESingle:msb: changed: #nextPutIEEEDouble: #nextPutIEEESingle:
Stream.st
--- a/Stream.st	Wed Mar 18 19:17:52 2015 +0100
+++ b/Stream.st	Thu Mar 19 22:44:52 2015 +0100
@@ -216,7 +216,6 @@
     ^ ChunkSeparator
 ! !
 
-
 !Stream methodsFor:'Compatibility-Dolphin'!
 
 display:someObject
@@ -226,8 +225,6 @@
     self nextPutAll: someObject asString.
 ! !
 
-
-
 !Stream methodsFor:'accessing'!
 
 contents
@@ -1012,12 +1009,24 @@
     ^ Float readBinaryIEEEDoubleFrom:self
 !
 
+nextIEEEDoubleMSB:msbFirst
+    "read an 8-byte IEEE double precision float number"
+
+    ^ Float readBinaryIEEEDoubleFrom:self MSB:msbFirst
+!
+
 nextIEEESingle
     "read a 4-byte IEEE single precision float number"
 
     ^ ShortFloat readBinaryIEEESingleFrom:self
 !
 
+nextIEEESingleMSB:msbFirst
+    "read a 4-byte IEEE single precision float number"
+
+    ^ ShortFloat readBinaryIEEESingleFrom:self MSB:msbFirst
+!
+
 nextLongMSB:msbFlag
     "return a signed long (4 bytes) from the stream.
      The receiver must support reading of binary bytes.
@@ -1616,13 +1625,25 @@
 nextPutIEEEDouble:aFloat
     "write an 8-byte IEEE double precision float number"
 
-    Float storeBinaryIEEEDouble:aFloat on:self
+    Float storeBinaryIEEEDouble:aFloat on:self MSB:(UninterpretedBytes isBigEndian)
+!
+
+nextPutIEEEDouble:aFloat msb:msb
+    "write an 8-byte IEEE double precision float number"
+
+    Float storeBinaryIEEEDouble:aFloat on:self MSB:msb
 !
 
 nextPutIEEESingle:aFloat
     "write a 4-byte IEEE single precision float number"
 
-    ShortFloat storeBinaryIEEESingle:aFloat on:self
+    ShortFloat storeBinaryIEEESingle:aFloat on:self MSB:(UninterpretedBytes isBigEndian).
+!
+
+nextPutIEEESingle:aFloat msb:msb
+    "write a 4-byte IEEE single precision float number"
+
+    ShortFloat storeBinaryIEEESingle:aFloat on:self MSB:msb.
 !
 
 nextPutLong:aNumber MSB:msbFlag
@@ -3757,11 +3778,11 @@
 !Stream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.239 2015-03-14 21:29:05 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.240 2015-03-19 21:44:52 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.239 2015-03-14 21:29:05 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.240 2015-03-19 21:44:52 cg Exp $'
 ! !