Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

[MBS] RamStream? (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] [ANN] 15.0pr8
Next thread: [MBS] NSImage : Name for Tags?


Re: [MBS] 9.3pr11   -   Garth Hjelte
  [MBS] RamStream?   -   Beatrix Willius
   Re: [MBS] RamStream?   -   Marnaud
   Re: [MBS] RamStream?   -   Christian Schmitz
   Re: [MBS] RamStream?   -   Marnaud
   Re: [MBS] RamStream?   -   Christian Schmitz
   Re: [MBS] RamStream?   -   Marnaud
   Re: [MBS] RamStream?   -   Christian Schmitz
   Re: [MBS] RamStream?   -   Marnaud
   Re: [MBS] RamStream?   -   Christian Schmitz

[MBS] RamStream?
Date: 18.01.15 18:14 (Sun, 18 Jan 2015 18:14:09 +0100)
From: Beatrix Willius
Hi,

got a stupid question: what exactly is a RamStream? Google is useless with such generic words. The documentation as usual is a bit terse:

class, RAMStream <http://www.monkeybreadsoftware.net/topic-ramstream.shtml>, MBS Util Plugin <http://www.monkeybreadsoftware.net/plugins-mbsutilplugin.shtml> (RAMStream <http://www.monkeybreadsoftware.net/pluginpart-ramstream.shtml>), class RAMStreamMBS <http://www.monkeybreadsoftware.net/class-ramstreammbs.shtml>,
Mac: Yes, Win: Yes, Linux: Yes, Console & Web: Yes, Feedback <http://www.monkeybreadsoftware.info/cgi-bin/docfeedback.cgi?path=RAMStreamMBS_class_RAMStreamMBS>.

On my G4 Dual 1000 Mhz, I get this result:
String only: 22063 ticks
RAMStream: 18 ticks

My application reads really large text files. The largest I know about is 15GB. At the moment I read this MB by MB.

Would is possible to get a constructor resulting in a StringHandleMBS instead of string or memoryblock? Whenever I tried StringHandleMBS the copying of data always made StringHandleMBS slow.

Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] RamStream?
Date: 18.01.15 23:41 (Sun, 18 Jan 2015 23:41:38 +0100)
From: Marnaud
Le 18 janv. 2015 à 23:28, Christian Schmitz <<email address removed>> a écrit:

> convert to string before?

Well, this would defeat the purpose of using a binary stream to append mixed values and reading the result as a string.
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] RamStream?
Date: 18.01.15 23:28 (Sun, 18 Jan 2015 23:28:58 +0100)
From: Christian Schmitz

>> Or use Join function.
>
> Well, for appending booleans (or non-string values), Join won't work.

convert to string before?

Greetings
Christian

Re: [MBS] RamStream?
Date: 18.01.15 23:27 (Sun, 18 Jan 2015 23:27:54 +0100)
From: Marnaud
Le 18 janv. 2015 à 23:23, Christian Schmitz <<email address removed>> a écrit:

> make sure all texts you put in have same encoding as when you read.

Good advice.

> Or use Join function.

Well, for appending booleans (or non-string values), Join won't work.
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] RamStream?
Date: 18.01.15 23:23 (Sun, 18 Jan 2015 23:23:20 +0100)
From: Christian Schmitz

>> Will put the two strings together.
>
> Hm… An interesting area of possibilities which I'll try soon; thank you!

make sure all texts you put in have same encoding as when you read.

Or use Join function.

Greetings
Christian

Re: [MBS] RamStream?
Date: 18.01.15 23:02 (Sun, 18 Jan 2015 23:02:24 +0100)
From: Marnaud
Le 18 janv. 2015 à 22:56, Christian Schmitz <<email address removed>> a écrit:

> Well, like this:
>
> dim m as new MemoryBlock(0)
> dim b as new BinaryStream(m)
>
> b.Write "Hello"
> b.Write "World"
>
> b.Position = 0
>
> dim s as string = b.Read(10, encodings.UTF8)
> MsgBox s
>
> Will put the two strings together.

Hm… An interesting area of possibilities which I'll try soon; thank you!
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] RamStream?
Date: 18.01.15 22:56 (Sun, 18 Jan 2015 22:56:06 +0100)
From: Christian Schmitz

>> The class is no longer needed, as Xojo can do the same with BinaryStream+Memoryblock or simply with Join function.
>
> So, how do you do the equivalent of “BinaryStream.AppendBoolean True”, except in memory only (so BinaryStream is useless), with a MemoryBlock?

Well, like this:

dim m as new MemoryBlock(0)
dim b as new BinaryStream(m)

b.Write "Hello"
b.Write "World"

b.Position = 0

dim s as string = b.Read(10, encodings.UTF8)
MsgBox s

Will put the two strings together.

Greetings
Christian

Re: [MBS] RamStream?
Date: 18.01.15 22:48 (Sun, 18 Jan 2015 22:48:36 +0100)
From: Marnaud
Le 18 janv. 2015 à 20:27, Christian Schmitz <<email address removed>> a écrit:

> The class is no longer needed, as Xojo can do the same with BinaryStream+Memoryblock or simply with Join function.

So, how do you do the equivalent of “BinaryStream.AppendBoolean True”, except in memory only (so BinaryStream is useless), with a MemoryBlock?
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] RamStream?
Date: 18.01.15 20:27 (Sun, 18 Jan 2015 20:27:26 +0100)
From: Christian Schmitz

> Am 18.01.2015 um 18:14 schrieb Beatrix Willius <<email address removed>>:
>
> Hi,
>
> got a stupid question: what exactly is a RamStream?

Like a binarystream, but in memory.

The class is no longer needed, as Xojo can do the same with BinaryStream+Memoryblock or simply with Join function.
(same for StringHandleMBS)

Greetings
Christian