Hi there,

My question is how could I output byte value (meaning zeros and ones) to screen.

I just want to try some shifts and see how it works.

## Recommended Answers

Jump to PostLook at the Integer class. It has methods to convert int values to different Strings for displaying.

Jump to Postit seems the way around and I'm not sure whether the result is what I need.

Can you show what the code outputs and explain what is wrong with it and give an example of what you want to print?

Jump to PostWithout the full data, I can not explain what you are seeing.

`S.o.p(Integer.toBinaryString( (int) arrayOfBytes[1]))`

What does arrayOfBytes[1] contain? It looks like it has an int value of 10

`S.o.p(getHexString(arrayOfBytes))`

What is arrayOfBytes here? What does the getHexString() method do? What does it take …

Jump to PostSo when I save one symbol to file, the file's content in binary format is just ASCII codes of that symbol and line feed symbol. Is that true?

Probably.

You should get a hex editor and look at the contents of a text file to see the values of the …

## All 14 Replies

NormR1
563
Posting Sage
Team Colleague

IcantC
0
Newbie Poster

NormR1
563
Posting Sage
Team Colleague

IcantC
0
Newbie Poster

NormR1
563
Posting Sage
Team Colleague

IcantC
0
Newbie Poster

NormR1
563
Posting Sage
Team Colleague

NormR1
563
Posting Sage
Team Colleague

IcantC
0
Newbie Poster

NormR1
563
Posting Sage
Team Colleague

NormR1
563
Posting Sage
Team Colleague

IcantC
0
Newbie Poster

NormR1
563
Posting Sage
Team Colleague

IcantC
0
Newbie Poster

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.