Package org.apache.sanselan.common

Examples of org.apache.sanselan.common.BinaryInputStream.readByteArray()


    BinaryInputStream bis = new BinaryInputStream(bytes, APP13_BYTE_ORDER);

    // Note that these are unsigned quantities. Name is always an even
    // number of bytes (including the 1st byte, which is the size.)

    byte[] idString = bis.readByteArray(
        PHOTOSHOP_IDENTIFICATION_STRING.length,
        "App13 Segment missing identification string");
    if (!compareByteArrays(idString, PHOTOSHOP_IDENTIFICATION_STRING))
      throw new ImageReadException("Not a Photoshop App13 Segment");
View Full Code Here


    // int index = PHOTOSHOP_IDENTIFICATION_STRING.length;

    while (true)
    {
      byte[] imageResourceBlockSignature = bis
          .readByteArray(CONST_8BIM.length,
              "App13 Segment missing identification string",
              false, false);
      if (null == imageResourceBlockSignature)
        break;
View Full Code Here

      {
        bis.read1ByteInteger("Image Resource Block has invalid name");
        blockNameBytes = new byte[0];
      } else
      {
        blockNameBytes = bis.readByteArray(blockNameLength,
            "Invalid Image Resource Block name", verbose, strict);
        if (null == blockNameBytes)
          break;

        if (blockNameLength % 2 == 0)
View Full Code Here

          .read4ByteInteger("Image Resource Block missing size");
      if (verbose)
        Debug.debug("blockSize", blockSize + " (0x"
            + Integer.toHexString(blockSize) + ")");

      byte[] blockData = bis.readByteArray(blockSize,
          "Invalid Image Resource Block data", verbose, strict);
      if (null == blockData)
        break;

      blocks.add(new IPTCBlock(blockType, blockNameBytes, blockData));
View Full Code Here

        BinaryInputStream bis = new BinaryInputStream(bytes, APP13_BYTE_ORDER);

        // Note that these are unsigned quantities. Name is always an even
        // number of bytes (including the 1st byte, which is the size.)

        byte[] idString = bis.readByteArray(
                PHOTOSHOP_IDENTIFICATION_STRING.length,
                "App13 Segment missing identification string");
        if (!compareByteArrays(idString, PHOTOSHOP_IDENTIFICATION_STRING))
            throw new ImageReadException("Not a Photoshop App13 Segment");
View Full Code Here

        // int index = PHOTOSHOP_IDENTIFICATION_STRING.length;

        while (true)
        {
            byte[] imageResourceBlockSignature = bis
                    .readByteArray(CONST_8BIM.length,
                            "App13 Segment missing identification string",
                            false, false);
            if (null == imageResourceBlockSignature)
                break;
View Full Code Here

            {
                bis.read1ByteInteger("Image Resource Block has invalid name");
                blockNameBytes = new byte[0];
            } else
            {
                blockNameBytes = bis.readByteArray(blockNameLength,
                        "Invalid Image Resource Block name", verbose, strict);
                if (null == blockNameBytes)
                    break;

                if (blockNameLength % 2 == 0)
View Full Code Here

             */
            if(blockSize > bytes.length) {
                throw new ImageReadException("Invalid Block Size : "+blockSize+ " > "+bytes.length);
            }

            byte[] blockData = bis.readByteArray(blockSize,
                    "Invalid Image Resource Block data", verbose, strict);
            if (null == blockData)
                break;

            blocks.add(new IPTCBlock(blockType, blockNameBytes, blockData));
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.