Issues about byte array in megabytes

Asked By 50 points N/A Posted on -
qa-featured

Array is most known in the world of java, and it is where I first encounter the word array. Now what is there a way we can convert a byte array in to megabytes? If it is possible how and what are the tools needed for the development and conversion flow. Please suggest about this.

Thank you

SHARE
Best Answer by Toni Linscomb
Answered By 60 points N/A #153531

Issues about byte array in megabytes

qa-featured

Hi Carol,

I checked your question and made a possible answers on your problem.  Array is really known not just in Java but also in the world of C Language. I have searched some sites that may help you with your bytes=Megabytes problems.

Kindly check the code on this site:

Calculation of bytes into Megabytes in Java

If you want to understand more about Arrays, Kindly Click this link:

Arrays on Java

Hope it would help you a lot.

Thanks.

Best Answer
Best Answer
Answered By 5 points N/A #153532

Issues about byte array in megabytes

qa-featured

You haven’t understood what a byte array is and what the use of it is.

A byte is basically a number from 0 to 255 (the numbers that can be represented in 8 bits). So a byte array is just an array of numbers 0 to 255.

At a lower level, An array is a contiguous block of memory and a byte array is just a representation of that memory in 8-bit chunks.

byte[] bytearray = new byte[] { 0, 1, 2, 3, 254, 255 };

We can use a byte array to store an image on a database. First we convert the image in to a stream of bytes and pass it to the database field created as a byte field. Later we can convert back the byte stream in to a viewable image.

So there is no such thing as converting byte array in to megabytes. 

Related Questions