January 14th, 2002 11:52 AM
reading a bitmap of 64bits ...pls help..
good day to all of u..
i am having a problem. i am writing an application in java which reads
records from a text file and posts then in oracle database.
but the problem is to find out what no. of fields are present in the
record i have to read a bitmap of 64 bits. and from that bitmap ,
the presence of 1 will tell me the presence of that no. of field.
can u pls help me how can i read the bitmap.
suppose i have a charcter of 8 bits + 8 bits then how can i make out
on what positions are the 1s and 0s present ????
urgent help needed....
January 14th, 2002 12:10 PM
I think that I speak for most of us when I say: "Euh?!?"
So, you're writing an application that reads recors from a textfile containing just ones and zeros? Are you looking for a method that reads bytes ?
January 14th, 2002 12:19 PM
thanks for replying ..but i am not looking for the method readBytes. as this method will read one byte at a time. and that is of 8 bits.
i want to read those 8 bits from one byte.
also the textfile is not containing all 0s and 1s only 8 characters that is 64 bits. i want to read. what should i do ??
thank u once again....
January 14th, 2002 12:33 PM
If you want to 'read those 8 bits from a byte' you mean you want them to be displayed as a string?
January 14th, 2002 12:54 PM
well that also will do. if i can convert that bitmap pattern in to a
string array which looks exactly like that then also my problem will be
ok here is a brief idea.
suppose the bitmap is of 16 bits. (for example)
which looks like this (suppose) :- 00000101 00000101
now this bitmap i cannot read directly to know the positions. now
if i can get the same pattern in a String form then i can easely find
out on what position is the field present i.e
let us count from left to right :-
0000010100000101 here the positions where the 1s are present
is 6th and 8th in the first byte and again 14th and 16th in the second.
so that means the 6th , 8th , 14th and 16th fields are present in the
hope u got the idea guss
so that way i have to read the record....pls help
but what to do...how ???