How to get sbyte[] from byte[]
-
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..
-
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..
-
plz try this code byte[] data = new byte[100]; sbyte[] s = (sbyte[])(Array)data;
Rajendran