Re: Byte



Anton Berikke wrote:
Wenn ich die toByte() Methode aufrufe -
dann ist die Ausgabe Binär, richtig?

Nö. "Binär" ist sowieso schon mal kaum ein Rückgabewert. Es ist einem
Byte egal, ob es binär, dez, oktal, hex oder sonstwie ausgegeben wird.
Das ist eine reine Interpretationsfrage - keine inhaltliche (BTW nicht
nur in Java nicht).

Im übrigen hängt der Rückgabewert einer toByte()-Methode davon ab, was
spezifiziert ist. Es könnte ein byte sein - es könnte aber auch ein Byte
sein, oder bei phantasievollen Implementeuren ein byte[] oder ein Byte[]
oder auch eine Banane. Du musst schon die Klasse mitberücksichtigen, aus
der diese Methode stammt.

Ich will nämlich eine Intziffer in eine Hexziffer umwandeln,
und diese dann wieder in ein Byte Array schreiben -
da kann ich doch auch gleich die Intziffer in ein Byte Array umwandeln,
oder??

Jede Intziffer (0-9) ist äquivalent zu ihrer Hexziffer 0-9, da brauchst
Du sowieso nichts zu wandeln. Oder meinst Du Zahlen?

Zahlen kann man auf die verschiedensten Arten in ein Byte-Array kopieren
- binär big Endian, little Endian, BCD, ... Da müsstest Du schon genauer
angeben, wie das geschehen soll.

Bye
Achim
.



Relevant Pages

  • Re: FloatToStr Reals and whole numbers on XP
    ... - Bit order when writing a hexadecimal constant. ... Endian when writing a multibye quantity as an array of bytes. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Converting to big -endian
    ... array an looped backwards then use the bitocnverter with the proper index. ... r u the same Kevin Spencer from takempis.com? ... Convert.ToUint16 only does extension and signed/unsigned conversion. ... a little endian machine ...
    (microsoft.public.dotnet.framework)
  • Re: Looking for a better way to do this
    ... I thought VB6 stored in Little Endian, ... is there actually an API call to swap Endians? ... (And check into whether it can work directly on the Variant array or if I wanna pull it out into a byte array or whatever.) ... Private Function CVSAs String ...
    (microsoft.public.vb.general.discussion)
  • Re: Question about 2D VB arrays
    ... argue the morality of 'little endian' over 'big endian'. ... block of memory - it's an object that contains information about where and ... COM/OLE structure and is defined as it is defined. ... A VB Array running in the IDE isn't ...
    (microsoft.public.vb.general.discussion)
  • Byte
    ... Ich will nämlich eine Intziffer in eine Hexziffer umwandeln, ... da kann ich doch auch gleich die Intziffer in ein Byte Array umwandeln, ...
    (de.comp.lang.java)