Code example for LineNumberReader

Methods: setLineNumber

    private int mEndLineNumber;
    private NativeHeapSnapshot mSnapshot;
    public NativeHeapDataImporter(Reader stream) {
        mReader = new LineNumberReader(stream);
        mReader.setLineNumber(1); // start numbering at 1
    public void run(IProgressMonitor monitor)
            throws InvocationTargetException, InterruptedException { 
        monitor.beginTask("Importing Heap Data", IProgressMonitor.UNKNOWN);
        List<NativeAllocationInfo> allocations = new ArrayList<NativeAllocationInfo>();
        try { 
            while (true) { 
                String line;
                StringBuilder sb = new StringBuilder();
                // read in a sequence of lines corresponding to a single NativeAllocationInfo