sedj
Programmer
- Aug 6, 2002
- 5,610
Hi,
I have a bunch of binary data stored in an Oracle database, which is running on an x86 little endian architecture.
The client machine is a big endian solaris box.
The data comes back (via Oracle Call Interface) as an array of Oracle's 'ub1' datatype - ie unsigned char (8 bit).
Some of the data is 8 bit data, some of it 32 bit (int) data.
Its a propriety format, so I know what the format of the data is. For example
In linux, I do something like :
Thats all well and good in a little endian architecture - but it gets a SIGSEGV in Solaris.
I think I need to convert the data from big endian to little endian - but I'm unsure of how to do it ...
Anybody got a clue of how to alter the endiness ?
Cheers for any help !
--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
I have a bunch of binary data stored in an Oracle database, which is running on an x86 little endian architecture.
The client machine is a big endian solaris box.
The data comes back (via Oracle Call Interface) as an array of Oracle's 'ub1' datatype - ie unsigned char (8 bit).
Some of the data is 8 bit data, some of it 32 bit (int) data.
Its a propriety format, so I know what the format of the data is. For example
In linux, I do something like :
Code:
ub1* ub1Data = GetData();
int i = (int)*ub1Data; // Grab 32 bytes off the data
ub1Data+=4; // shift the pointer on for the next data
Thats all well and good in a little endian architecture - but it gets a SIGSEGV in Solaris.
I think I need to convert the data from big endian to little endian - but I'm unsure of how to do it ...
Anybody got a clue of how to alter the endiness ?
Cheers for any help !
--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software