Examples of LShrinkArray


Examples of lev.LShrinkArray

        }
        try {
            String fileName;
            int fileCounter = 0;
            in.pos(offset);
            LShrinkArray folderData = new LShrinkArray(in.extract(0, folderCount * 16));
            posAtFilenames();
            LShrinkArray fileNames = new LShrinkArray(in.extract(0, fileNameLength));
            for (int i = 0; i < folderCount; i++) {
                BSAFolder folder = new BSAFolder();
                folderData.skip(8); // Skip Hash
                folder.setFileCount(folderData.extractInt(4));
                folder.dataPos = folderData.extractInt(4);
                posAtFolder(folder);
                folder.name = in.extractString(0, in.read() - 1) + "\\";
                folder.name = folder.name.toUpperCase();
                in.skip(1);
                folders.put(folder.name, folder);
                if (SPGlobal.debugBSAimport && SPGlobal.logging()) {
                    SPGlobal.logSpecial(LogTypes.BSA, header, "Loaded folder: " + folder.name);
                }
                for (int j = 0; j < folder.fileCount; j++) {
                    BSAFileRef f = new BSAFileRef();
                    f.size = in.extractInt(8, 3); // Skip Hash
                    LFlags sizeFlag = new LFlags(in.extract(1));
                    f.flippedCompression = sizeFlag.get(6);
                    f.dataOffset = in.extractLong(0, 4);
                    fileName = fileNames.extractString();
                    folder.files.put(fileName.toUpperCase(), f);
                    if (SPGlobal.logging()) {
                        SPGlobal.logSpecial(LogTypes.BSA, header, "  " + fileName + ", size: " + Ln.prettyPrintHex(f.size) + ", offset: " + Ln.prettyPrintHex(f.dataOffset));
                        fileCounter++;
                    }
View Full Code Here

Examples of lev.LShrinkArray

     */
    public LShrinkArray getFile(String filePath) throws IOException, DataFormatException {
        BSAFileRef ref;
        if ((ref = getFileRef(filePath)) != null) {
            in.pos(getFileLocation(ref));
            LShrinkArray out = new LShrinkArray(in.extract(0, ref.size));
            trimName(out);
            if (isCompressed(ref)) {
                out = out.correctForCompression();
            }
            return out;
        }
        return new LShrinkArray(new byte[0]);
    }
View Full Code Here

Examples of lev.LShrinkArray

     */
    static public LShrinkArray getUsedFile(String filePath) throws IOException, DataFormatException {
        File outsideBSA = new File(SPGlobal.pathToData + filePath);
        if (outsideBSA.isFile()) {
            SPGlobal.logSpecial(LogTypes.BSA, header, "Loaded from loose files: " + outsideBSA.getPath());
            return new LShrinkArray(outsideBSA);
        } else {
            Iterator<BSA> bsas = BSA.iterator();
            BSA tmp, bsa = null;
            while (bsas.hasNext()) {
                tmp = bsas.next();
View Full Code Here

Examples of lev.LShrinkArray

    void parseData(LImport in, Mod srcMod) throws BadRecord, DataFormatException, BadParameter {
  super.parseData(in, srcMod);
  int numTextures = in.extractInt(4);
  for (int i = 0; i < numTextures; i++) {
      int strLength = Ln.arrayToInt(in.getInts(0, 4));
      AltTexture newText = new AltTexture(new LShrinkArray(in.extract(12 + strLength)), srcMod);
      altTextures.add(newText);
      if (logging()) {
    logMod(srcMod, "", "New Texture Alt -- Name: " + newText.name + ", texture: " + newText.texture + ", index: " + newText.index);
      }
  }
View Full Code Here

Examples of lev.LShrinkArray

     * standards)
     */
    public NIF(File f) throws FileNotFoundException, IOException, BadParameter {
  LInChannel in = new LInChannel(f);
  fileName = f.getPath();
  parseData(new LShrinkArray(in.extractByteBuffer(0, in.available())));
    }
View Full Code Here

Examples of lev.LShrinkArray

      strings.add(in.extractString(in.extractInt(4)));
  }
  in.skip(4); // unknown int

  for (int i = 0; i < numBlocks; i++) {
      nodes.get(i).data = new LShrinkArray(in, nodes.get(i).size);
      in.skip(nodes.get(i).size);
  }

  //Set titles
  for (int i = 0; i < numBlocks; i++) {
View Full Code Here

Examples of lev.LShrinkArray

  Node(Node in) {
      this.title = in.title;
      this.type = in.type;
      this.size = in.size;
      this.data = new LShrinkArray(in.data);
      this.number = in.number;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.