Package org.jnetstream.capture

Examples of org.jnetstream.capture.FileCapture


  public <T extends FileCapture<? extends FilePacket>> T newFile(
      final Class<T> c, final File file) throws IOException,
      FileFormatException {

    if (c == PcapFile.class) {
      final FileCapture pcap =
          PcapFileCapture.createFile(file, FileMode.ReadWrite,
              ByteOrder.BIG_ENDIAN, null);
      return c.cast(pcap);
    }
    if (c == SnoopFile.class) {
      final FileCapture snoop =
          SnoopFileCapture.createFile(file, FileMode.ReadWrite, null);
      return c.cast(snoop);
    } else {
      throw new FileFormatException("Unknown file format " + c.getName());
    }
View Full Code Here


    if (logger.isDebugEnabled()) {
      logger.debug(file.getName() + ", type=" + type.getName()
          + (filter == null ? "" : ", filter=" + filter));
    }

    FileCapture capture;
    if (type == PcapFile.class) {
      capture = new PcapFileCapture(file, mode, null);
    } else if (type == SnoopFile.class) {
      capture = new SnoopFileCapture(file, mode, null);
    } else {
View Full Code Here

        count = Captures.count(input.getPacketIterator());
        input.close();
        break;

      default:
        final FileCapture capture = openFile(dst);
        count = capture.getPacketCount();
        capture.close();

        break;
    }

    return count;
View Full Code Here

TOP

Related Classes of org.jnetstream.capture.FileCapture

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.