Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3974734
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:36:10+00:00 2026-05-20T04:36:10+00:00

We are developing an Android Application (Java) that reads an image, encode the bytes

  • 0

We are developing an Android Application (Java) that reads an image, encode the bytes in base64 to send them over HTTP (via GET) to a WebService written in VB.NET.

On .NET side, they are using this :

Dim Pix As Image
Pix = Image.FromFile("C:\Users\Public\Pictures\Sample Pictures\Tree.jpg")

Dim ms As New MemoryStream
Pix.Save(ms, ImageFormat.Jpeg)
Dim ImByte() As Byte = ms.GetBuffer
ms.Close()

Sounds great.

How can I pass the correct string to them to correctly decode the image from Java encoding (unsigned) to .NET decoding (signed)?

Many thanks
Nicolas.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T04:36:11+00:00Added an answer on May 20, 2026 at 4:36 am

    First mistake: you’re using GetBuffer() which will potentially be too big. Use ToArray() instead.

    On the Java side, just use any Base64 decoder, such as the Apache Commons Codec one. Don’t worry about the signedness of the bytes – Base64 effectively makes that a non-issue for you.

    That’s assuming the web service client doesn’t perform this automatically for you, of course… if your web service “advertises” a byte array using base64, it may well just be automatic.

    Side question: why bother loading the image as an image at all? Why not just use:

    Dim ImByte() As Byte = File.ReadAllBytes("C:\Users\...\Tree.jpg")
    

    ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently developing an Android application that fetches images using http requests. It would
I'm developing an augmented reality application for Android that uses the phone's camera to
i am developing an application that reads and writes data remotely on an SQL
I am developing an android application in eclipse that needs to use JSON, Google
i have developing an android application that requests an httpget and then it converts
I am developing an Android application that is linked into a Wordpress site. I
As part of an application that I'm developing for Android I'd like to show
I am developing an Android application that controls the PC keyboard and mouse. I
I'm working on a project that requires developing an android application for a galaxy
I'm developing an application that is supposed to run on both Android as well

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.