Announcement

Collapse
No announcement yet.

Short in Byte[] schreiben

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Short in Byte[] schreiben

    wie kann ich einen shortwert (Längenangabe des Arrays) in die Pos 5 und 6 des Byte[] schreiben. Der Socket-Server erwartet dies an der Stelle.

  • #2
    Nach Intel (erst Low-Byte) wäre es:
    bytearray[5] = (byte)(shortwert & 0xFF);
    bytearray[6] = (byte)((shortwert >> 8) & 0xFF);

    Ciao Ja

    Comment

    Working...
    X