Re: BinaryReader and BinaryWriter and Endianess
From: Michel Gallant (neutron_at_NOSPAMistar.ca)
Date: 02/11/04
- Next message: geng shang: "Runtime and OS report different mem usage"
- Previous message: Jon Skeet [C# MVP]: "Re: How can I get Http Status Code?"
- Maybe in reply to: Eric Newton: "Re: BinaryReader and BinaryWriter and Endianess"
- Next in thread: Jon Skeet [C# MVP]: "Re: BinaryReader and BinaryWriter and Endianess"
- Reply: Jon Skeet [C# MVP]: "Re: BinaryReader and BinaryWriter and Endianess"
- Messages sorted by: [ date ] [ thread ]
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.
> > >
> >
> >
>
- Next message: geng shang: "Runtime and OS report different mem usage"
- Previous message: Jon Skeet [C# MVP]: "Re: How can I get Http Status Code?"
- Maybe in reply to: Eric Newton: "Re: BinaryReader and BinaryWriter and Endianess"
- Next in thread: Jon Skeet [C# MVP]: "Re: BinaryReader and BinaryWriter and Endianess"
- Reply: Jon Skeet [C# MVP]: "Re: BinaryReader and BinaryWriter and Endianess"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|