Re: BinaryReader and BinaryWriter and Endianess

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Michel Gallant (neutron_at_NOSPAMistar.ca)
Date: 02/11/04


Date: Wed, 11 Feb 2004 14:09:11 -0500

Basically that is correct. The BinaryWriters write multi-bytes
as little-endian ordered. E.g. Win .wav files write multi-byte
samples in little-endian order. Reading these types of files from
Java requires reversing the data.
Compare to write methods on Java that write data in big-endian ordered fashion.

However, .NET doesn't *always* write multi-byte data out in little-endian
ordering. To "bow" to the majority of the crypt community, many parameters
(like RSA key properties) are created internally and reordered to big-endian
ordered byte[]

- Michel Gallant
   MVP Security

"Paul Selormey" <paul@toolscenter.org> wrote in message
news:%23IL47hy5DHA.2524@TK2MSFTNGP11.phx.gbl...
> So, for the .NET framework implemented by Microsoft for the
> Windows, what is the picture like? (could not find any hint in the
> documents)
>
> Best regards,
> Paul.
>
>
> <discussion@discussion.microsoft.com> wrote in message
> news:%23mMeHMx5DHA.2056@TK2MSFTNGP10.phx.gbl...
> > Thats implementation specific for the runtime ported to whatever
> underlaying
> > platform shouldnt it?
> >
> >
> > "Paul Selormey" <paul@toolscenter.org> wrote in message
> > news:uCBIGCx5DHA.2732@TK2MSFTNGP09.phx.gbl...
> > > .NET is mainly designed for Windows and could be assumed to
> > > work with only little endian binary files.
> > >
> > > However, what is the real behavior?
> > >
> > > BinaryReader : Is this designed to read system/hardware supported
> > > endian of will always read little endian no matter the system?
> > >
> > > BinaryWriter: Is this designed to always write little endian binary or
> > > it depends on the system?
> > >
> > > I wish to know in order to extend these classes.
> > >
> > > BTW, anyone got extends to support big endian binary files?
> > >
> > > Best regards,
> > > Paul.
> > >
> >
> >
>



Relevant Pages

  • Re: [SLE] Console CD Ripping
    ... > Anyone recommend their favorite ... > and Jack are loaded, also the Java RE is running fine (jEdit loads great ... It *does* however create intermediate .wav files. ...
    (SuSE)
  • Wav file transcription using CMU Sphinx-4 - need help
    ... I got Sphinx-4 installed on my windows XP and JSAPI set up. ... Since I don't know Java I am not able to proceed further :-( ... I am converting them to wav files now. ...
    (comp.speech.research)
  • Re: How to get the length of wav file?
    ... This looks like Java. ... If you want help with Java code, ... but it claims to "extract useful information like their duration ... and filesize" from WAV files. ...
    (comp.lang.perl.modules)