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 - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.trace
;
15 import java
.io
.FileNotFoundException
;
16 import java
.io
.IOException
;
17 import java
.io
.RandomAccessFile
;
20 import org
.eclipse
.linuxtools
.tmf
.stream
.AbstractTmfEventStream
;
21 import org
.eclipse
.linuxtools
.tmf
.stream
.ITmfEventParser
;
24 * <b><u>TmfEventStreamStub</u></b>
26 * TODO: Implement me. Please.
28 public class TmfEventStreamStub
extends AbstractTmfEventStream
{
30 // ========================================================================
32 // ========================================================================
35 private final RandomAccessFile fStream
;
37 // ========================================================================
39 // ========================================================================
44 * @throws FileNotFoundException
46 public TmfEventStreamStub(String filename
, ITmfEventParser parser
) throws FileNotFoundException
{
47 this(filename
, parser
, DEFAULT_CACHE_SIZE
);
54 * @throws FileNotFoundException
56 public TmfEventStreamStub(String filename
, ITmfEventParser parser
, int cacheSize
) throws FileNotFoundException
{
57 super(filename
, parser
, cacheSize
);
58 fStream
= new RandomAccessFile(filename
, "r");
62 // ========================================================================
64 // ========================================================================
66 public RandomAccessFile
getStream() {
70 // ========================================================================
72 // ========================================================================
75 * @see org.eclipse.linuxtools.tmf.eventlog.ITmfStreamLocator#seekLocation(java.lang.Object)
77 public StreamContext
seekLocation(Object location
) {
78 StreamContext context
= null;
80 fStream
.seek((location
!= null) ?
(Long
) location
: 0);
81 context
= new StreamContext(getCurrentLocation());
82 } catch (IOException e
) {
83 // TODO Auto-generated catch block
90 * @see org.eclipse.linuxtools.tmf.eventlog.ITmfStreamLocator#getCurrentLocation()
92 public Object
getCurrentLocation() {
94 return new Long(fStream
.getFilePointer());
95 } catch (IOException e
) {
96 // TODO Auto-generated catch block
102 // ========================================================================
104 // ========================================================================
107 * @see org.eclipse.linuxtools.tmf.eventlog.ITmfEventStream#getAttributes()
109 public Map
<String
, Object
> getAttributes() {
110 // TODO Auto-generated method stub
This page took 0.032337 seconds and 5 git commands to generate.