java - How to continue looping through DataInputStream? -
I am reading a binary file and I have to parse this file in the header.
Set up a Given this, it is the location field of There are currently many issues like I DataInputStream and I need to keep looping through the file till the end. I'm new in Java so I'm not sure how I will achieve this from my own C # experience. At the moment I have the following code:
while (is.position! = Is.length) {if (card == employee) {System.out.print (card); } And if (card == student) {System.out.print (card); } And if (card == admin) {System.out.print (card); } Else {System.out.print ("wrong"); }}
is the input stream I have created, the only error I have is in the first line, where the loop of time starts under the condition and it It says that they can not be solved or there is no field.
DataInputStream Perhaps you can use one of the other ways to check whether or not available, but this is not clear from your code sample what you are trying to do.
card ,
employee ,
student and
admin
string , you have to compare them using the
par (string s) method, not
== <
is.position (I know that it does not actually exist, but hypothetically speaking ...) so if you can enter the loop then You'll never leave it.
card . If you repeat a certain number, you will only continue to print the same output that is repeatedly printed, which may The purpose is not to be.
Comments
Post a Comment