realbasic-nug
[Top] [All Lists]

Re: BinaryStream to MemoryBlock

To: "REALbasic NUG" <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: BinaryStream to MemoryBlock
From: "Daniel Chiaramello" <dchiaramello at madwaves dot com>
Date: Tue, 28 Feb 2006 09:40:50 +0100
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <6C8CC36D-4DF1-4753-9508-A1C5E614330C at frontiernet dot net><0C793071-8B67-44BA-8D52-88005902DE80 at mobleybros dot com> <2884A5EC-8669-4909-A863-70807231192D at frontiernet dot net>
Maybe because it's not new MemoryBlock but newmemoryblock (single word)?
----- Original Message ----- From: "Harrie Westphal" <harriew at frontiernet dot net>
To: "REALbasic NUG" <realbasic-nug at lists dot realsoftware dot com>
Sent: Monday, February 27, 2006 7:49 PM
Subject: Re: BinaryStream to MemoryBlock



On Feb 27, 2006, at 11:58 AM, Phil M wrote:

You can also assign a string like this:

    Dim mb As MemoryBlock = b.Read(b.Length)    // b is a BinaryStream

This is because there is an automatic conversion between string and MemoryBlock (REALbasic 5.5 and higher), so a MemoryBlock will be created to

Thanks Phil, that worked like a charm and beats the heck out of reading it byte by byte. Not sure I would have ever thought to try doing this within the Dim statement.

In case anyone has followed this thread the following example from Brian does not work, giving a "This method or property does not exist on the last line:

j = theFile.Length
mb = New MemoryBlock(j)

mb.String(0, j) = b.Read(j)

=== A Mac addict in Tennessee ===

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>