Package org.jnetstream.capture

Examples of org.jnetstream.capture.FileFormatException


     
    } else if (header.get(0) == PcapFile.MAGIC_PATTERN_LE[0]) {
      return ByteOrder.LITTLE_ENDIAN;
     
    } else {
      throw new FileFormatException("Invalid PCAP block header magic number");
    }
  }
View Full Code Here


    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 (type == PcapFile.class) {
      capture = new PcapFileCapture(file, mode, null);
    } else if (type == SnoopFile.class) {
      capture = new SnoopFileCapture(file, mode, null);
    } else {
      throw new FileFormatException("Unsupported file format type, "
          + type.getName());
    }

    return type.cast(capture);
  }
View Full Code Here

  }

  public long countPackets(File dst) throws IOException, FileFormatException {
    final FormatType type = formatType(dst);
    if (type == null) {
      throw new FileFormatException("Unrecognized file format");
    }

    final long count;

    switch (type) {
View Full Code Here

      throws FileFormatException {

    if (header.get(0) == SnoopBlockRecord.MAGIC_PATTERN[0]) {
      return ByteOrder.BIG_ENDIAN;
    } else {
      throw new FileFormatException("Invalid SNOOP block header magic number");
    }
  }
View Full Code Here

TOP

Related Classes of org.jnetstream.capture.FileFormatException

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.