1. Welcome Guest! In order to create a new topic or reply to an existing one, you must register first. It is easy and free. Click here to sign up now!.
    Dismiss Notice

Converting bits and bytes

Discussion in 'Microsoft News' started by NewsBot, Mar 23, 2008.

  1. NewsBot

    NewsBot I Got News

    Joined:
    Feb 8, 2006
    Messages:
    1,813
    Operating System:
    Windows Vista Home Premium
    I'm implementing a specification to send and receive data from an external device. The 'lowest' layer which accepts a byte array is done but I'm having trouble converting all the variables from the upper layer to a byte array.

    For example, there is an integer field that is 4 bits long. Let's say I have the following variables:

    varone(2) as byte
    vartwo as byte
    varthree(4) as bitarray 'an integer field
    varfour(3) as byte
    varfive as byte
    varsix(4) as bitarray 'a second integer field

    How do I take all these variables together (preserving the sequence) to a single byte array?




     

Share This Page