cbrune
asked on
How do I get the byte position of the first character in a line?? the first chracter byte position of each reader.readline???
How do I get the byte position of the first character in a line?? the first chracter byte position of each reader.readline???
private static void displayTextInputStream(Inp utStream input)
throws IOException {
// Read one text line at a time and display.
BufferedReader reader = new BufferedReader(new
InputStreamReader(input));
while (true) {
String line = reader.readLine();
if (line == null) break;
System.out.println(" " + line);
}
System.out.println();
}
private static void displayTextInputStream(Inp
throws IOException {
// Read one text line at a time and display.
BufferedReader reader = new BufferedReader(new
InputStreamReader(input));
while (true) {
String line = reader.readLine();
if (line == null) break;
System.out.println(" " + line);
}
System.out.println();
}
ASKER
I mean the overall byte mark of the starting character for the whole file
I mean the overall byte mark of the starting character for the whole file
What do you mean by "overall byte mark" ? The number of bytes will usually be the same as the number of characters in the file.
ASKER
if i need to skip to the beginning of a certain line in the file. as you are reading line by line I need the first byte position marker of where it is in the whole file so I can skip to that particular position.
"position here"test,test,test
"position here"test1,test1,test1
"position here"test2,test2,test2
So I can skip to the front of the line and read the whole record
"position here"test,test,test
"position here"test1,test1,test1
"position here"test2,test2,test2
So I can skip to the front of the line and read the whole record
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Closed.
Each 'line' is a String. So the position of the first character in it will be 0 in the CharSequence array.