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

    Default Read varbinary data in java

    Hello,
    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?
    Regards…

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    9,944
    Rep Power
    16

    Default Re: Read varbinary data in java

    Why do they call it rush hour when nothing moves? - Robin Williams

Similar Threads

  1. Read data from custom ca
    By Petr in forum Java Servlet
    Replies: 2
    Last Post: 05-11-2011, 12:19 PM
  2. Replies: 1
    Last Post: 03-29-2011, 08: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, 11:39 AM
  4. Replies: 1
    Last Post: 11-09-2010, 09:28 AM
  5. Replies: 1
    Last Post: 02-04-2010, 09: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
  •