realbasic-nug
[Top] [All Lists]

Re: how to store mp3 files on realSQLdatabases

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: how to store mp3 files on realSQLdatabases
From: Joe Huber <joehuber at talasoft dot com>
Date: Mon, 28 Apr 2008 18:20:23 -0700
Authentication-results: mx.google.com; spf=pass (google.com: domain of realbasic-nug-bounces at lists dot realsoftware dot com designates 66.116.103.65 as permitted sender) smtp dot mail=realbasic-nug-bounces at lists dot realsoftware dot com
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <8823 dot 98085 dot qm at web30704 dot mail dot mud dot yahoo dot com> <2A4E1142-3741-4272-92D5-47AD8FDACD58 at great-white-software dot com> <5BB7E95F-7F91-4CB6-8E32-840D1F80D896 at sqlabs dot net> <DD4154C3-A38B-4C02-971F-4ACEA7998D9F at great-white-software dot com> <BA6DCE5E-83ED-4A67-8990-1973FDF09B70 at tolisgroup dot com> <95C0FA34-F52D-41C2-8E10-84939B9E328D at sqlabs dot net> <77124270804281732s135c129doc15bb48578c4ca3c at mail dot gmail dot com>
At 6:32 PM -0600 4/28/08, Peter K. Stys wrote:
>At the moment, say I have 1 million UInt16's representing 16-bit per pixel
>image data, stored in BLOB fields in a REALSQLdatabase file.  When I save
>this on PPC and then read it on Intel, the UInt16 byte pairs are reversed
>and must be byte-swapped.

Yes, of course. The two million byte string aka blob has no inherent 
endianness and so will come out just the way it went in, even when 
transferred between different endian platforms.

The endianness only comes into play when you try to interpret some of 
those bytes as integers or other numeric types. There's no way that a 
database could know what or how you packed the data into the string.

You should be able to easily handle this by putting the string into a 
memoryblock and just setting the memoryblock.LittleEndian property to 
the current platform endianness.

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

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


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