FileStream vs GsFile

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FileStream vs GsFile

BrunoBB
Hi,

My Seside application has two services:
1- PUT that is called by a Java app to store a file.
2- GET that is called by a Java app to obtain the stored file.

I have noticed that GsFile is much more faster than FileStream (in writting).

The problem that i'm having is with the GET service.
It seems that:
FileStream read: myPathFile type: #binary.
"is NOT equivalent with: "
GsFile openOnServer: myPathFile  mode: 'rb'.

"to pupulate the file i use #nextPutAll: #flush #close en both cases"

With FileStream it works ok, with GsFile the Java fail with the following error:
xf:submission: binary serialization with anyURI type failed reading URL.  

Are these two sentences equivalent ?

Of course i wanna use GsFile because is much faster.

Still researching this...

Regards,
Bruno
Reply | Threaded
Open this post in threaded view
|

Re: FileStream vs GsFile

BrunoBB
Hi,

I have solved this with a GsFile.

"aGsFile contents" message was changed with "aGsFile contentsAsUtf8" and the Java app seems happy with it.

Regards,
Bruno
Reply | Threaded
Open this post in threaded view
|

Re: FileStream vs GsFile

GLASS mailing list


On Wed, Aug 19, 2015 at 4:32 PM, BrunoBB via Glass <[hidden email]> wrote:
Hi,

I have solved this with a GsFile.

"aGsFile contents" message was changed with "aGsFile contentsAsUtf8" and the
Java app seems happy with it.


As an alternative you can also convert to UTF8 each while writing rather than altogether at the end:


forceNewUTF8FileNamed: aFilename withString: aString
| file |
file := (GsFile open: aFilename mode: 'w' onClient: false).
file nextPutAll: aString encodeAsUTF8.
file close.

Cheers,

Regards,
Bruno



--
View this message in context: http://forum.world.st/FileStream-vs-GsFile-tp4844137p4844139.html
Sent from the GLASS mailing list archive at Nabble.com.
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass



--

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass