Package com.voytechs.jnetstream.io

Examples of com.voytechs.jnetstream.io.RawformatInputStream


    public PacketTraceIterator(String fileName) throws FileNotFoundException, IOException, EOPacketStream, StreamFormatException, SyntaxError {
        logger = Logger.getLogger(this.getClass().getName());
        //logger = Logger.getLogger("PacketTraceIterator");
       
        this.fileName = fileName;
        in = new RawformatInputStream(fileName);
        logger.info("Packet trace file: " + fileName);
       
    }
View Full Code Here


        return in.isPacketReady();
    }
   
    /** @return the time of the first packet in the trace file */
    public long getStartTime() throws FileNotFoundException, IOException, EOPacketStream, StreamFormatException, SyntaxError {
        RawformatInputStream tempIn;
        tempIn = new RawformatInputStream(fileName);
        tempIn.nextPacket();
        return tempIn.getCaptureTimestamp().getTime();
    }
View Full Code Here

        return tempIn.getCaptureTimestamp().getTime();
    }
   
    /** @return the time of the last packet in the trace file */
    public long getFinishTime() throws FileNotFoundException, IOException, EOPacketStream, StreamFormatException, SyntaxError {
        RawformatInputStream tempIn;
        long startTime;
       
        startTime = System.currentTimeMillis();
       
        tempIn = new RawformatInputStream(fileName);
        int count = 0;
        try {
            while ( true ) {
                count++;
                tempIn.nextPacket();
                //System.out.println("Count: " + count + " at time " + tempIn.getCaptureTimestamp().getTime());
            }
        } catch (EOPacketStream e) {
        } catch (StreamFormatException e) {
        }
        logger.debug("Time taken: " + (System.currentTimeMillis() - startTime));
        return tempIn.getCaptureTimestamp().getTime();
    }
View Full Code Here

       
    }
    */
   
    protected void dumpMetaData() throws FileNotFoundException, IOException, EOPacketStream, StreamFormatException, SyntaxError {
        RawformatInputStream stream;
        java.util.Enumeration metaData;
        //CaptureMetaEnumerator metaData;
        MetaValue value;
       
        stream = new RawformatInputStream(fileName);
        metaData = stream.getMetaEnumeration();
       
        while ( metaData.hasMoreElements() ) {
            value = ((CaptureMetaEnumerator)metaData).nextMetaValue();
            logger.info("Meta value: " + value);
        }
View Full Code Here

TOP

Related Classes of com.voytechs.jnetstream.io.RawformatInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.