Results 1 to 2 of 2
Thread: Read varbinary data in java
- 06-16-2012, 02:18 PM #1Member
- Join Date
- Jun 2012
- Rep Power
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?
- 06-16-2012, 03:19 PM #2
Re: Read varbinary data in java
.net - Read varbinary data in java - Stack Overflow
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
- By Petr in forum Java ServletReplies: 2Last Post: 05-11-2011, 12:19 PM
- By renu in forum New To JavaReplies: 1Last Post: 03-29-2011, 08:59 AM
- By prabhug1987 in forum NetworkingReplies: 0Last Post: 12-03-2010, 12:39 PM
- By yashrajsen in forum AWT / SwingReplies: 1Last Post: 11-09-2010, 10:28 AM
- By motress in forum EclipseReplies: 1Last Post: 02-04-2010, 10:17 PM