1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Francois Chouinard (fchouinard@gmail.com) - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.lttng
.stubs
;
15 import java
.io
.FileNotFoundException
;
16 import java
.io
.IOException
;
17 import java
.io
.RandomAccessFile
;
20 import org
.eclipse
.linuxtools
.tmf
.trace
.ITmfEventParser
;
21 import org
.eclipse
.linuxtools
.tmf
.trace
.TmfTrace
;
24 * <b><u>TmfEventStreamStub</u></b>
26 * TODO: Implement me. Please.
28 public class LTTngEventStreamStub
extends TmfTrace
{
30 // ========================================================================
32 // ========================================================================
35 private final RandomAccessFile fStream
;
37 // ========================================================================
39 // ========================================================================
44 * @throws FileNotFoundException
46 public LTTngEventStreamStub(String filename
, ITmfEventParser parser
) throws FileNotFoundException
{
47 this(filename
, parser
, DEFAULT_CACHE_SIZE
);
54 * @throws FileNotFoundException
56 public LTTngEventStreamStub(String filename
, ITmfEventParser parser
, int cacheSize
) throws FileNotFoundException
{
57 super(filename
, parser
, cacheSize
);
58 fStream
= new RandomAccessFile(filename
, "r");
61 // ========================================================================
63 // ========================================================================
65 public RandomAccessFile
getStream() {
69 // ========================================================================
71 // ========================================================================
74 * @see org.eclipse.linuxtools.tmf.eventlog.ITmfStreamLocator#seekLocation(java.lang.Object)
76 public StreamContext
seekLocation(Object location
) {
77 StreamContext context
= null;
79 fStream
.seek((location
!= null) ?
(Long
) location
: 0);
80 context
= new StreamContext(getCurrentLocation(), 0);
81 } catch (IOException e
) {
82 // TODO Auto-generated catch block
89 * @see org.eclipse.linuxtools.tmf.eventlog.ITmfStreamLocator#getCurrentLocation()
91 public Object
getCurrentLocation() {
93 return new Long(fStream
.getFilePointer());
94 } catch (IOException e
) {
95 // TODO Auto-generated catch block
101 // ========================================================================
103 // ========================================================================
106 * @see org.eclipse.linuxtools.tmf.eventlog.ITmfEventStream#getAttributes()
108 public Map
<String
, Object
> getAttributes() {
109 // TODO Auto-generated method stub
This page took 0.053292 seconds and 5 git commands to generate.