on test_encode
fx = xtra("fileIO").new()
ms = the milliseconds
fx.openFile("c:\test.jpg", 1)
len = fx.getLength()
ba = fx.readByteArray(len)
fx.closeFile()
b64 = script("base64_class").new()
b64.setMimeHeader("test.jpg")
data = b64.encode(ba, 0)
b64 = 0
fx.createFile("c:\test.b64")
fx.openFile("c:\test.b64", 2)
fx.writeString(data)
fx.closeFile()
put (the milliseconds-ms) && "ms"
fx=0
end
on test_decode
fx = xtra("fileIO").new()
ms = the milliseconds
fx.openFile("c:\test.b64", 1)
data = fx.readFile()
fx.closeFile()
b64 = script("base64_class").new()
ba = b64.decode(data)
b64 = 0
fx.createFile("c:\new.jpg")
fx.openFile("c:\new.jpg", 2)
fx.writeByteArray(ba)
fx.closeFile()
put (the milliseconds-ms) && "ms"
fx=0
end