Same as {@link #decipher(GetObjectRequest, long[], long[], S3Object)}
but makes use of an instruction file with the specified suffix.
@param instFileSuffix never null or empty (which is assumed to have been
sanitized upstream.)
186775
private S3Object decipherWithInstFileSuffix(GetObjectRequest req,
            long[] desiredRange, long[] cryptoRange, S3Object retrieved,
            String instFileSuffix) {
        final S3ObjectId id = req.getS3ObjectId();
        // Check if encrypted info is in an instruction file
        final S3ObjectWrapper ifile = fetchInstructionFile(id, instFileSuffix);
        if (ifile == null) {
            throw new SdkClientException("Instruction file with suffix "
                    + instFileSuffix + " is not found for " + retrieved);
        }
        try {
            return decipherWithInstructionFile(req, desiredRange,
                    cryptoRange, new S3ObjectWrapper(retrieved, id), ifile);
        } finally {
            closeQuietly(ifile, log);
        }
    }
719733
static private boolean checkfpx(InputStream is) throws IOException {

        /* Test for FlashPix image data in Microsoft Structured Storage format.
         * In general, should do this with calls to an SS implementation.
         * Lacking that, need to dig via offsets to get to the FlashPix
         * ClassID.  Details:
         *
         * Offset to Fpx ClsID from beginning of stream should be:
         *
         * FpxClsidOffset = rootEntryOffset + clsidOffset
         *
         * where: clsidOffset = 0x50.
         *        rootEntryOffset = headerSize + sectorSize*sectDirStart
         *                          + 128*rootEntryDirectory
         *
         *        where:  headerSize = 0x200 (always)
         *                sectorSize = 2 raised to power of uSectorShift,
         *                             which is found in the header at
         *                             offset 0x1E.
         *                sectDirStart = found in the header at offset 0x30.
         *                rootEntryDirectory = in general, should search for
         *                                     directory labelled as root.
         *                                     We will assume value of 0 (i.e.,
         *                                     rootEntry is in first directory)
         */

        // Mark the stream so we can reset it. 0x100 is enough for the first
        // few reads, but the mark will have to be reset and set again once
        // the offset to the root directory entry is computed. That offset
        // can be very large and isn't know until the stream has been read from
        is.mark(0x100);

        // Get the byte ordering located at 0x1E. 0xFE is Intel,
        // 0xFF is other
        long toSkip = (long)0x1C;
        long posn;

        if ((posn = skipForward(is, toSkip)) < toSkip) {
          is.reset();
          return false;
        }

        int c[] = new int[16];
        if (readBytes(c, 2, is) < 0) {
            is.reset();
            return false;
        }

        int byteOrder = c[0];

        posn+=2;
        int uSectorShift;
        if (readBytes(c, 2, is) < 0) {
            is.reset();
            return false;
        }

        if(byteOrder == 0xFE) {
            uSectorShift = c[0];
            uSectorShift += c[1] << 8;
        }
        else {
            uSectorShift = c[0] << 8;
            uSectorShift += c[1];
        }

        posn += 2;
        toSkip = (long)0x30 - posn;
        long skipped = 0;
        if ((skipped = skipForward(is, toSkip)) < toSkip) {
          is.reset();
          return false;
        }
        posn += skipped;

        if (readBytes(c, 4, is) < 0) {
            is.reset();
            return false;
        }

        int sectDirStart;
        if(byteOrder == 0xFE) {
            sectDirStart = c[0];
            sectDirStart += c[1] << 8;
            sectDirStart += c[2] << 16;
            sectDirStart += c[3] << 24;
        } else {
            sectDirStart =  c[0] << 24;
            sectDirStart += c[1] << 16;
            sectDirStart += c[2] << 8;
            sectDirStart += c[3];
        }
        posn += 4;
        is.reset(); // Reset back to the beginning

        toSkip = 0x200L + (long)(1<<uSectorShift)*sectDirStart + 0x50L;

        // Sanity check!
        if (toSkip < 0) {
            return false;
        }

        /*
         * How far can we skip? Is there any performance problem here?
         * This skip can be fairly long, at least 0x4c650 in at least
         * one case. Have to assume that the skip will fit in an int.
         * Leave room to read whole root dir
         */
        is.mark((int)toSkip+0x30);

        if ((skipForward(is, toSkip)) < toSkip) {
            is.reset();
            return false;
        }

        /* should be at beginning of ClassID, which is as follows
         * (in Intel byte order):
         *    00 67 61 56 54 C1 CE 11 85 53 00 AA 00 A1 F9 5B
         *
         * This is stored from Windows as long,short,short,char[8]
         * so for byte order changes, the order only changes for
         * the first 8 bytes in the ClassID.
         *
         * Test against this, ignoring second byte (Intel) since
         * this could change depending on part of Fpx file we have.
         */

        if (readBytes(c, 16, is) < 0) {
            is.reset();
            return false;
        }

        // intel byte order
        if (byteOrder == 0xFE &&
            c[0] == 0x00 && c[2] == 0x61 && c[3] == 0x56 &&
            c[4] == 0x54 && c[5] == 0xC1 && c[6] == 0xCE &&
            c[7] == 0x11 && c[8] == 0x85 && c[9] == 0x53 &&
            c[10]== 0x00 && c[11]== 0xAA && c[12]== 0x00 &&
            c[13]== 0xA1 && c[14]== 0xF9 && c[15]== 0x5B) {
            is.reset();
            return true;
        }

        // non-intel byte order
        else if (c[3] == 0x00 && c[1] == 0x61 && c[0] == 0x56 &&
            c[5] == 0x54 && c[4] == 0xC1 && c[7] == 0xCE &&
            c[6] == 0x11 && c[8] == 0x85 && c[9] == 0x53 &&
            c[10]== 0x00 && c[11]== 0xAA && c[12]== 0x00 &&
            c[13]== 0xA1 && c[14]== 0xF9 && c[15]== 0x5B) {
            is.reset();
            return true;
        }
        is.reset();
        return false;
    }
164247
public static String getPrefixOfFileName(String fileName) {
        int dotIndex = fileName.lastIndexOf(DOT);
        return dotIndex > 0 ? fileName.substring(0, dotIndex) : fileName;
    }
802243
@Override
    protected void initializeImpl()
    {
        //initialize
        super.initializeImpl();

        //get temporary directory
        File directory=IOHelper.getFax4jInternalTemporaryDirectory();

        //get exe path
        String fax4jExe=Fax4jExeConstants.FAX4J_EXE.toString();
        File exeFile=new File(directory,fax4jExe);
        if(exeFile.exists())
        {
            this.fax4jExecutableFileLocation=exeFile.getPath();
        }
        else
        {
            exeFile=IOHelper.getFileFromNativePath(fax4jExe);
            if(exeFile!=null)
            {
                this.fax4jExecutableFileLocation=exeFile.getPath();
            }
        }

        //get fax server name
        this.faxServerName=WindowsFaxClientSpiHelper.getServerNameFromConfiguration(this);

        //set defaults
        this.useWindowsCommandPrefix=false;
    }
1366946
protected final <T extends AItemSpecifics<?,  ?>> int findFirstIdxFor(final List<T> pOutdGdSpList, final IHasIdLongVersionName pItem) {
    int j = 0;
    while (!pOutdGdSpList.get(j).getItem().getItsId().equals(pItem.getItsId())) {
      j++;
    }
    return j;
  }
1078953
@Override
    public void visitInsn(int inst) {
        processPendingExceptionHandlerEntry(-1);

        // List of opcodes taken from visitInsn documentation
        if (waitingForSuper) {
            // Visit the instruction
            super.visitInsn(inst);

            switch (inst) {
                case NOP:
                    break;
                // One slot constants
                case ACONST_NULL:
                case ICONST_M1:
                case ICONST_0:
                case ICONST_1:
                case ICONST_2:
                case ICONST_3:
                case ICONST_4:
                case ICONST_5:
                case FCONST_0:
                case FCONST_1:
                case FCONST_2:
                    push(OTHER, 1);
                    break;
                // Two slot constants
                case DCONST_0:
                case DCONST_1:
                case LCONST_0:
                case LCONST_1:
                    push(OTHER, 2);
                    break;
                // One slot array load
                case IALOAD:
                case FALOAD:
                case AALOAD:
                case BALOAD:
                case CALOAD:
                case SALOAD:
                    pop(1); // pop(2); push(OTHER, 1);
                    break;
                // Two slot array load
                case DALOAD:
                case LALOAD:
                    // pop(2); push(OTHER, 2);
                    break;
                // One slot array store
                case IASTORE:
                case FASTORE:
                case AASTORE:
                case BASTORE:
                case CASTORE:
                case SASTORE:
                    pop(3);
                    break;
                // Two slot array store
                case DASTORE:
                case LASTORE:
                    pop(4);
                    break;
                // Basic pop instructions
                case POP:
                    pop(1);
                    break;
                case POP2:
                    pop(2);
                    break;
                // Stack manipulation instructions
                case DUP: {
                    Object top = currentStack.get(currentStack.size() - 1);
                    push(top, 1);
                    break;
                }
                case DUP_X1: {
                    Object top = currentStack.get(currentStack.size() - 1);
                    int addPosition = currentStack.size() - 2;
                    currentStack.add(addPosition, top);
                    break;
                }
                case DUP_X2: {
                    Object top = currentStack.get(currentStack.size() - 1);
                    int addPosition = currentStack.size() - 3;
                    currentStack.add(addPosition, top);
                    break;
                }
                case DUP2: {
                    int position = currentStack.size() - 2;
                    currentStack.add(currentStack.get(position));
                    currentStack.add(currentStack.get(position + 1));
                    break;
                }
                case DUP2_X1: {
                    int addPosition = currentStack.size() - 3;
                    currentStack.add(addPosition, currentStack.get(currentStack.size() - 1));
                    currentStack.add(addPosition, currentStack.get(currentStack.size() - 2));
                    break;
                }
                case DUP2_X2: {
                    int addPosition = currentStack.size() - 4;
                    currentStack.add(addPosition, currentStack.get(currentStack.size() - 1));
                    currentStack.add(addPosition, currentStack.get(currentStack.size() - 2));
                    break;
                }
                case SWAP: {
                    Object o = currentStack.remove(currentStack.size() - 2);
                    currentStack.add(o);
                    break;
                }
                // One slot arithmetic and logical instructions
                case IADD:
                case FADD:
                case ISUB:
                case FSUB:
                case IMUL:
                case FMUL:
                case IDIV:
                case FDIV:
                case IREM:
                case FREM:
                case INEG:
                case FNEG:
                case ISHL:
                case ISHR:
                case IUSHR:
                case IAND:
                case IOR:
                case IXOR:
                    pop(1);
                    break;
                // Two slot arithmetic and logical instructions
                case DADD:
                case LADD:
                case DSUB:
                case LSUB:
                case DMUL:
                case LMUL:
                case DDIV:
                case LDIV:
                case DREM:
                case LREM:
                case DNEG:
                case LNEG:
                case LSHL:
                case LSHR:
                case LUSHR:
                case LAND:
                case LOR:
                case LXOR:
                    pop(2);
                    break;
                // One slot to two slot conversions
                case I2D:
                case I2L:
                case F2D:
                case F2L:
                    push(OTHER, 1);
                    break;
                // One slot to one slot conversions
                case F2I:
                case I2B:
                case I2C:
                case I2F:
                case I2S:
                    break;
                // Two slot to one slot conversions
                case D2F:
                case D2I:
                case L2I:
                case L2F:
                    pop(1);
                    break;
                // Two slot to two slot conversions
                case L2D:
                case D2L:
                    break;
                // Two slot compare
                case DCMPL:
                case DCMPG:
                case LCMP:
                    pop(3);
                    break;
                // One slot compare
                case FCMPL:
                case FCMPG:
                    pop(1);
                    break;
                // One slot return
                case IRETURN:
                case FRETURN:
                case ARETURN:
                    pop(1);
                    break;
                // Two slot return
                case DRETURN:
                case LRETURN:
                    pop(2);
                    break;
                // Zero slot return
                case RETURN:
                    break;
                // Get array length
                case ARRAYLENGTH:
                    break;
                // Throw an exception
                case ATHROW:
                    pop(1);
                    break;
                // Enter or leave a monitor
                case MONITORENTER:
                case MONITOREXIT:
                    pop(1);
                    break;
                default:
            }
        } else {
            // Handle return and throw instructions
            switch (inst) {
                case RETURN:
                case ARETURN:
                case DRETURN:
                case FRETURN:
                case IRETURN:
                case LRETURN:
                    if (onMethodReturn()) {
                        visitFrameAfterMethodReturnCallback();
                    }
                    break;
                case ATHROW:
                    if (onThrowInstruction()) {
                        visitFrameAfterOnThrowCallback();
                    }
                    break;
            }
            super.visitInsn(inst);
        }
    }
360540
public static String tryToTrimToSize(String s, int length, boolean trimSuffix) {
        if (s == null || s.isEmpty()) {
            return s;
        } else if (s.length() <= length) {
            return s;
        } else if (s.contains(File.separator)) {
            String before = s.substring(0, s.lastIndexOf(File.separator));
            String after = s.substring(s.lastIndexOf(File.separator));
            if (!trimSuffix && length - after.length() > 4) {
                return Strings.tryToTrimToSize(before, length - after.length(), true) + after;
            } else {
                return Strings.tryToTrimToSize(before, length - 3, true) + File.separator + "..";
            }
        } else {
            return "..";
        }
    }
1307237
def parse_ins_file(ins_file):
    

    obs_names = []
    with open(ins_file,'r') as f:
        header = f.readline().strip().split()
        assert header[0].lower() in ["pif","jif"],\
            "instruction file error: must start with [pif,jif], not:" +\
            str(header[0])
        marker = header[1]
        assert len(marker) == 1,\
            "instruction file error: marker must be a single character, not:" +\
            str(marker)
        for line in f:
            line = line.lower()
            if marker in line:
                raw = line.lower().strip().split(marker)
                for item in raw[::2]:
                    obs_names.extend(parse_ins_string(item))
            else:
                obs_names.extend(parse_ins_string(line.strip()))
    #obs_names = [on.strip().lower() for on in obs_names]
    return obs_names
1143002
@Override
	public InputSource resolveNormalized(String identifier) {
		String fileName = identifier;
		if (!fileName.endsWith(".css")) {
			fileName += ".scss";
		}

		List<Class<?>> excluded = new ArrayList<>();
		excluded.add(ISassResourceGenerator.class);
		Reader rd = null;
		try {
			rd = rsHandler.getResource(bundle, fileName, false, excluded);
			FilePathMapping linkedResource = getFilePathMapping(fileName);
			if (linkedResource != null) {
				addLinkedResource(linkedResource);
				if (bundle != null) {
					bundle.getLinkedFilePathMappings().add(
							new FilePathMapping(bundle, linkedResource.getPath(), linkedResource.getLastModified()));
				}
			}
		} catch (ResourceNotFoundException e) {
			// Do nothing
		}

		if (rd != null) {

			InputSource source = new InputSource();
			source.setCharacterStream(rd);
			source.setURI(fileName);
			return source;
		} else {
			return null;
		}
	}
1014038
function getResourcePath(sResourceName, sSuffix) {

		var sNamePrefix = sResourceName,
			p = sResourceName.length,
			sPath;

		// search for a registered name prefix, starting with the full name and successively removing one segment
		while ( p > 0 && !mUrlPrefixes[sNamePrefix] ) {
			p = sNamePrefix.lastIndexOf('/');
			// Note: an empty segment at p = 0 (leading slash) will be ignored
			sNamePrefix = p > 0 ? sNamePrefix.slice(0, p) : '';
		}

		assert((p > 0 || sNamePrefix === '') && mUrlPrefixes[sNamePrefix], "there always must be a mapping");

		sPath = mUrlPrefixes[sNamePrefix].url + sResourceName.slice(p + 1); // also skips a leading slash!

		//remove trailing slash
		if ( sPath.slice(-1) === '/' ) {
			sPath = sPath.slice(0, -1);
		}
		return sPath + (sSuffix || '');

	}
390233
public static Long decodeLongObj(byte[] src, int srcOffset)
        throws CorruptEncodingException
    {
        try {
            int b = src[srcOffset];
            if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) {
                return null;
            }
            return decodeLong(src, srcOffset + 1);
        } catch (IndexOutOfBoundsException e) {
            throw new CorruptEncodingException(null, e);
        }
    }
1347252
@Override
	public JavaFileObject getJavaFileForOutput(final Location location, final String className, final Kind kind, final FileObject sibling) throws IOException {
		
		JavaClassObject obj = new JavaClassObject(className, kind);
		
		objects.put(className, obj);
		
		return obj;
	}
786190
@Override
    public String fromSuffixToPackageName(final String suffix) {
        if (LdiStringUtil.isEmpty(suffix)) {
            throw new EmptyRuntimeException("suffix");
        }
        return suffix.toLowerCase();
    }
653120
public static String createEndSuffixFileName(String fileName, String endSuffix) {
        int    index       = fileName.lastIndexOf(".");
        String preFileName = fileName.substring(0, index);
        String suffix      = fileName.substring(index);
        return preFileName + endSuffix + suffix;
    }
824338
function getNextIFDOffset(dataView, dirStart, bigEnd){
        //the first 2bytes means the number of directory entries contains in this IFD
        var entries = dataView.getUint16(dirStart, !bigEnd);

        // After last directory entry, there is a 4bytes of data,
        // it means an offset to next IFD.
        // If its value is '0x00000000', it means this is the last IFD and there is no linked IFD.

        return dataView.getUint32(dirStart + 2 + entries * 12, !bigEnd); // each entry is 12 bytes long
    }
460716
private void readObject(java.io.ObjectInputStream s)
        throws java.io.IOException, ClassNotFoundException
    {
        s.defaultReadObject();
        if (encryptedContent != null)
            encryptedContent = encryptedContent.clone();
        if (encodedParams != null)
            encodedParams = encodedParams.clone();
    }
14731
public boolean hasContentTypeEngine(String contentTypeOrSuffix) {
        String sanitizedTypes = sanitizeContentTypes(contentTypeOrSuffix);
        String[] types = sanitizedTypes.split(",");
        for (String type : types) {
            if (engines.containsKey(type)) {
                return true;
            }
        }

        return suffixes.containsKey(contentTypeOrSuffix.toLowerCase());
    }