@Override\r
public TmfContext seekLocation(double ratio) {\r
try {\r
- RandomAccessFile raFile = new RandomAccessFile(getPath(), "r"); //$NON-NLS-1$\r
- ITmfLocation<?> location = new TmfLocation<Long>(new Long((long) (ratio * raFile.length())));\r
+ BufferedRandomAccessFile raFile = new BufferedRandomAccessFile(getPath(), "r"); //$NON-NLS-1$\r
+ long pos = (long) (ratio * raFile.length());\r
+ while (pos > 0) {\r
+ raFile.seek(pos - 1);\r
+ if (raFile.read() == '\n') break;\r
+ pos--;\r
+ }\r
+ ITmfLocation<?> location = new TmfLocation<Long>(new Long(pos));\r
TmfContext context = seekLocation(location);\r
context.setRank(ITmfContext.UNKNOWN_RANK);\r
return context;\r
\r
@Override\r
public ITmfLocation<?> getCurrentLocation() {\r
- return new TmfLocation<Object>(null);\r
+ // TODO Auto-generated method stub\r
+ return null;\r
}\r
\r
@Override\r