Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to get sbyte[] from byte[]

How to get sbyte[] from byte[]

Scheduled Pinned Locked Moved ASP.NET
javahelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Prateek G
    wrote on last edited by
    #1

    Hi, I am using zip method provided by java.util.zip which takes input as sbyte[].I am getting response from a function in Stream.This stream is a file data.And when I am making conversion from byte[] to sbyte[] because of some Data loss I am not able to open the file which gives error like file is corrupted or damaged. I can think of some solutions but here are the problems with them- 1.> Can I convert this Stream to sbyte[],presently I am converting it to byte[] through MemoryStream. 2.> Presently I am directly putting this byte[] to Response.BinaryWrite() and its working but how to do that with sbyte[] conversion from byte[] to sbyte[] to create a zip entry and then again converting it to byte[] for Response.BinaryWrite can damage the file. Any suggestion will be appreciated.. Prateek..

    R 1 Reply Last reply
    0
    • P Prateek G

      Hi, I am using zip method provided by java.util.zip which takes input as sbyte[].I am getting response from a function in Stream.This stream is a file data.And when I am making conversion from byte[] to sbyte[] because of some Data loss I am not able to open the file which gives error like file is corrupted or damaged. I can think of some solutions but here are the problems with them- 1.> Can I convert this Stream to sbyte[],presently I am converting it to byte[] through MemoryStream. 2.> Presently I am directly putting this byte[] to Response.BinaryWrite() and its working but how to do that with sbyte[] conversion from byte[] to sbyte[] to create a zip entry and then again converting it to byte[] for Response.BinaryWrite can damage the file. Any suggestion will be appreciated.. Prateek..

      R Offline
      R Offline
      r a j u u
      wrote on last edited by
      #2

      plz try this code byte[] data = new byte[100]; sbyte[] s = (sbyte[])(Array)data;

      Rajendran

      P 1 Reply Last reply
      0
      • R r a j u u

        plz try this code byte[] data = new byte[100]; sbyte[] s = (sbyte[])(Array)data;

        Rajendran

        P Offline
        P Offline
        Prateek G
        wrote on last edited by
        #3

        No, Still I am not able to open the file its given same error.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups