Package org.jakstab.loader

Examples of org.jakstab.loader.BinaryParseException


      offset += 2;
    }

    private final short makeShort(byte[] val, int offset, boolean isle) throws BinaryParseException {
      if (val.length < offset + 2)
        throw new BinaryParseException("Offset out of range when reading Short.");
      if (isle) {
        return (short) ( (val[offset + 1] << 8) + val[offset + 0]);
      }
      return (short) ( (val[offset + 0] << 8) + val[offset + 1]);
    }
View Full Code Here


      return (short) ( (val[offset + 0] << 8) + val[offset + 1]);
    }

    private final long makeInt(byte[] val, int offset, boolean isle) throws BinaryParseException {
      if (val.length < offset + 4)
        throw new BinaryParseException("Offset out of range when reading Int.");
      if (isle) {
        return ( (val[offset + 3] << 24) + (val[offset + 2] << 16) + (val[offset + 1] << 8) + val[offset + 0]);
      }
      return ( (val[offset + 0] << 24) + (val[offset + 1] << 16) + (val[offset + 2] << 8) + val[offset + 3]);
    }
View Full Code Here

    }

    private final long makeUnsignedLong(byte[] val, int offset, boolean isle) throws BinaryParseException {
      long result = makeLong(val, offset, isle);
      if (result < 0) {
        throw new BinaryParseException("Maximal file offset is " + Long.toHexString(Long.MAX_VALUE) + //$NON-NLS-1$
            " given offset is " + Long.toHexString(result)); //$NON-NLS-1$
      }
      return result;

    }
View Full Code Here

TOP

Related Classes of org.jakstab.loader.BinaryParseException

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.