Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!

Al Hobbs

Ranch Hand
+ Follow
since Aug 30, 2017
Al likes ...
Netbeans IDE
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
13
Received in last 30 days
0
Total given
7
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Al Hobbs

Hey
ive seen people store files as hexadecimal  text and i thought that doing that would increase the needed space by at least 2.  I was thinking about it and got confused on whether it would actually use more space or  not

I dont have any plans on doing that.  It was a purely theoretical question.

Thanks
2 weeks ago

Paul Clapham wrote:It isn't clear what numbers you are talking about



The numbers would be the char representation of the byte.

I initially thought it would be much bigger if the byte array was converted into char representation.  It would be 2 - 4 times bigger.

I got confused because I don't how bytes are actually stored or used..?  




I think another example where I think about this is if I had an image file and then I converted it to a byte array, then a string representation and then wrote it to a text file, the text file would be bigger.
2 weeks ago
Hi,  
I have a question which probably isnt specific to java but I'm not sure where it would go.  

My questions is basically asking about data is actually used on a lower level.

If I have an image file, then I convert it into a byte array, then I convert that byte array into a string containing the numbers, which one would be smaller in size?  

To add on to that question, is there a difference in response size/ speed if a byte array is in the response body or a string containing the numbers?

Also, is the answer different if using hex?

Thank you
2 weeks ago
I think it's good to just think of objects like a set of code that is separated from the main code so that you can use it later.

In your post you had a program that printed out two chairs and a table.  If you were to make that into objects you could have an object that would print from a string, list, or a file and then instead of having a program that prints only chairs and tables, you'd have a program that can print whatever text you give it.
4 months ago
You should probably find resources in your native language.  Just search java and jsp on google.
4 months ago
Do you have tests or done debugging?
4 months ago
Out of memory error seems like that would have to do with the actual hardware on your computer hence the error part.
4 months ago
Goodjob  sounds good.  You are using onPreferncechanged to detect the change?
4 months ago
Ok so if want to make a web app you arent going to be getting input using the console.  I think make you should read up on basic jsp and servlet first.
4 months ago
Actually....... you have java code slapped in an html page... No wonder it doesn't work.  
4 months ago
This question isn't even about cookies and tokens.  It's about Httpsession.  Where did you get these questions from then?
4 months ago
Do you have both versions on your computer and then you are changing your environment variables?
4 months ago
Are you sure this isn't your homework?  I find it hard to believe you are thinking up all these diverse questions so quickly. Maybe they're from a book or your teacher? FESS UP.
4 months ago