how to convert an sByte array to byte array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • reju

    how to convert an sByte array to byte array

    I have to convert an sByte array to byte array.
    This sbyte array contains some signed values due to this .net
    converting functions will throw an exception.any work around for this?

    is there any way to pass sbyte array to stream classes eg: memory
    stream?

  • =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=

    #2
    RE: how to convert an sByte array to byte array

    Howdy,

    sbyte[] src = new sbyte[] { -1, 1, -2, 2 };
    byte[] dest = new byte[src.Length];
    System.Buffer.B lockCopy(src, 0, dest, 0, src.Length);
    --
    Milosz


    "reju" wrote:
    I have to convert an sByte array to byte array.
    This sbyte array contains some signed values due to this .net
    converting functions will throw an exception.any work around for this?
    >
    is there any way to pass sbyte array to stream classes eg: memory
    stream?
    >
    >

    Comment

    • reju

      #3
      Re: how to convert an sByte array to byte array

      On Feb 21, 3:02 pm, Milosz Skalecki [MCAD] <mily...@DONTLI KESPAMwp.pl>
      wrote:
      Howdy,
      >
      sbyte[] src = new sbyte[] { -1, 1, -2, 2 };
      byte[] dest = new byte[src.Length];
      System.Buffer.B lockCopy(src, 0, dest, 0, src.Length);
      --
      Milosz
      >
      "reju" wrote:
      I have to convert an sByte array to byte array.
      This sbyte array contains some signed values due to this .net
      converting functions will throw an exception.any work around for this?
      >
      is there any way to pass sbyte array to stream classes eg: memory
      stream?

      Great Milosz

      it works
      Thanks

      Comment

      • RichZilla

        #4
        Re: how to convert an sByte array to byte array

        On Feb 21, 3:54 am, "reju" <rejumgeo...@gm ail.comwrote:
        On Feb 21, 3:02 pm, Milosz Skalecki [MCAD] <mily...@DONTLI KESPAMwp.pl>
        wrote:
        >
        Howdy,
        >
        sbyte[] src = newsbyte[] { -1, 1, -2, 2 };
        byte[] dest = newbyte[src.Length];
        System.Buffer.B lockCopy(src, 0, dest, 0, src.Length);
        --
        Milosz
        >
        "reju" wrote:
        I have toconvertansByt earray tobytearray.
        Thissbytearray contains some signed values due to this .net
        converting functions will throw an exception.any work around for this?
        >
        is there any way to passsbytearray to stream classes eg: memory
        stream?
        >
        Great Milosz
        >
        it works
        Thanks
        Yeah, Thanks too!

        Comment

        Working...