Results 1 to 2 of 2
  1. #1
    msd1357 is offline Member
    Join Date
    Jun 2012
    Rep Power

    Default Read varbinary data in java

    I made a android application which read some files from SQL server. Those files saved to a varbinary(MAX) field in SQL Server by a third party web service. My problem is that when I want to read those files by my java application, those binary data shows deferent content in java application. In fact I read data byte by byte and I configure that some bytes couldn’t show real values which saved in the data base. I find out that what the problem is, but I couldn’t find a solution yet. I find out that in the web service every varbinary data saves to database as byte data (in .Net each byte takes 0 to 255). But when I want to read the binary data in java, it takes deferent values and cause exception in some values. Because in java byte value takes -127 to 127.
    In my java application I want to write those data to a file by OutputStream.write(byte[]) method. How can I solve this problem? I think that I have to find a way to convert c# byte[] to java byte[] (or binary data), but how can I do that?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: Read varbinary data in java

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Read data from custom ca
    By Petr in forum Java Servlet
    Replies: 2
    Last Post: 05-11-2011, 01:19 PM
  2. Replies: 1
    Last Post: 03-29-2011, 09:59 AM
  3. how read a data from a cheque scanner in java
    By prabhug1987 in forum Networking
    Replies: 0
    Last Post: 12-03-2010, 12:39 PM
  4. Replies: 1
    Last Post: 11-09-2010, 10:28 AM
  5. Replies: 1
    Last Post: 02-04-2010, 10:17 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts