User Tools

Site Tools


shapechange

Shape Change

2013/05/12. This works. See also TestDuration class»dumpedObjectAsLiteralString:.

The mutate:* method goes on the Class side!

	| stream byteArray dt |

	dt := DateAndTime year: 1989 day: 240 hour: 05 minute: 04  second: 03. 
	stream := ReadWriteStream on: ByteArray new.
	ObjectDumper new unload: dt intoStream: stream.
	byteArray := stream contents.

	stream := WriteStream on: (String new: 2000).
	stream nextPutAll: '#('.
	byteArray doWithIndex: [:byte :i |
		i \\ 30 = 0 ifTrue: [stream cr].
		byte printOn: stream.
		i = byteArray size ifFalse: [stream space]].
	stream nextPut: $).

	stream contents
shapechange.txt · Last modified: 2013/05/19 08:58 by 127.0.0.1