code: private byte[] readXBytesFromTcpdump(int x) {
  
          byte[] buffer = new byte[x];
  
          try {
              int read = tcpDumpReader.read(buffer);
              if ( x == -1 ) {
                  throw new ParserFailureException("Attempted to read pass the size of the tcpdump file, tcpDumpPos:"
                          + tcpDumpPos + ", attempted to read " + x + " bytes");
              }
              tcpDumpPos += read;
              if ( read != x )
                  throw new ParserFailureException("Tried to read over the size of the file");
              return buffer;
          }
          catch (IOException e) {
              e.printStackTrace();
              throw new ParserFailureException("Failed to read from tcpdump file: ");
          }
  
      }
docs: /*
  Reads x bytes from tcpdump