Java 8 IIOException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 IIOException class.

This code example shows how to use the following methods:
    public static IIOImage readImage(File input) throws IOException {
        if (input == null) {
            throw new IllegalArgumentException("input == null!");
        } 
        if (!input.canRead()) {
            throw new IIOException("Can't readImage input file!");
        } 
 
        ImageInputStream stream = ImageIO.createImageInputStream(input);
        if (stream == null) {
            throw new IIOException("Can't create an ImageInputStream!");
        } 
        return readImage(stream);
    } 
 
    /** 
     * Returns a <code>BufferedImage</code> as the result of decoding a supplied <code>ImageInputStream</code> with an 
     * <code>ImageReader</code> chosen automatically from among those currently registered.  If no registered 
     * <code>ImageReader</code> claims to be able to readImage the stream, <code>null</code> is returned. 
     * 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCause
      return true; 
    } catch (final IndexOutOfBoundsException e) {
      // truncated 
      return false; 
    } catch (final IIOException e) {
      if (e.getCause() instanceof EOFException) {
        // truncated 
        return false; 
      } 
    } catch (Exception e) {
      return false; 
    } finally { 
      is.close(); 
    } 
    return true; 
  } 
 
 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    public boolean canDecodeInput(File file) throws IOException {
        if (file ==null){
            throw new IllegalArgumentException("file == null!");
        } 
        if (!file.canRead()){
            throw new IIOException("cannot read the input file");
        } 
 
        // set-up a FileChannel instance for a given file object 
        FileChannel srcChannel = new FileInputStream(file).getChannel();
 
        // create a read-only MappedByteBuffer 
        MappedByteBuffer buff = srcChannel.map(FileChannel.MapMode.READ_ONLY, 0, DTA_HEADER_SIZE);
 
        //printHexDump(buff, "hex dump of the byte-buffer"); 
 
        buff.rewind();
 
        dbgLog.fine("applying the dta test\n"); 
 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
            } else  
                processWarningOccurred("Error calculating offset"); 
                      
             
        } catch (IOException e) {
            throw new IIOException("I/O error reading header!", e);
        } 
 
        gotTiffHeader = true;
    } 
 
    private int locateImage(int imageIndex) throws IIOException {
        readHeader(); 
 
        try { 
            // Find closest known index 
            int index = Math.min(imageIndex, imageStartPosition.size() - 1);
 
            // Seek to that position 
            long l = imageStartPosition.get(index);
1
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        try { 
            stream = ImageIO.createImageOutputStream(outputFile);
        } catch (IIOException e) {
            throw e;
        } catch (IOException e) {
            throw new IIOException("Failed to create TIFF output stream.", e);
        } 
 
        boolean writerFound = false;
        try { 
            writerFound = writeImage(image, stream, geoTIFFMetadata);
        } finally { 
            stream.close();
        } 
 
        return writerFound;
    } 
 
 
    /** 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	 *             if no GIF image writers are returned 
	 */ 
	private static ImageWriter getWriter() throws IIOException {
		Iterator<ImageWriter> iter = ImageIO.getImageWritersBySuffix("gif");
		if (!iter.hasNext()) {
			throw new IIOException("No GIF Image Writers Exist");
		} else { 
			return iter.next();
		} 
	} 
 
	/** 
	 * Returns an existing child node, or creates and returns a new child node 
	 * (if the requested node does not exist). 
	 * 
	 * @param rootNode 
	 *            the <tt>IIOMetadataNode</tt> to search for the child node. 
	 * @param nodeName 
	 *            the name of the child node. 
	 * 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        int length = pInput.readInt();
        if (length == 0) {
            throw new IIOException("No palette information in PSD");
        } 
        else if (length % 3 != 0) {
            throw new IIOException("Wrong palette information in PSD");
        } 
 
        // NOTE: Spec says length may only be 768 bytes (256 RGB triplets) 
        colors = new byte[length];
        pInput.readFully(colors);
 
        // NOTE: Could be a padding byte here, if not even.. 
    } 
 
    IndexColorModel getIndexColorModel() {
        if (colorModel == null) {
            int[] rgb = toInterleavedRGB(colors);
            colorModel = new InverseColorMapIndexColorModel(8, rgb.length, rgb, 0, false, -1, DataBuffer.TYPE_BYTE);
        } 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	    } else { 
		next = flipTable[data[bp + 1] & 0xff];
		next2next = flipTable[data[bp + 2] & 0xff];
	    } 
	} else { 
            throw new IIOException("Invalid FillOrder");
	} 
 
	int bitsLeft = 8 - bitPointer;
	int bitsFromNextByte = bitsToGet - bitsLeft;
	int bitsFromNext2NextByte = 0;
	if (bitsFromNextByte > 8) {
	    bitsFromNext2NextByte = bitsFromNextByte - 8;
	    bitsFromNextByte = 8;
	} 
	 
	bytePointer++;
 
	int i1 = (b & table1[bitsLeft]) << (bitsToGet - bitsLeft);
	int i2 = (next & table2[bitsFromNextByte]) >>> (8 - bitsFromNextByte);
2
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        else if (type == 2) {
            Color color = readRGBColor(pStream);
            pattern = new PixMapPattern(color, fallback);
        } 
        else { 
            throw new IIOException(String.format("Unknown QuickDraw pattern type '0x%04x'", type));
        } 
 
        return pattern;
    } 
 
    /** 
     * Reads an {@link RGBColor} record from the given stream. 
     * 
     * @param pStream the input stream 
     * @return the color read 
     * 
     * @throws java.io.IOException if an I/O error occurs during read 
     */ 
    /* 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
            processThumbnailComplete(); 
 
            return thumbnail;
        } 
        else { 
            throw new IIOException("Unsupported EXIF thumbnail compression: " + compression);
        } 
    } 
 
    private BufferedImage readJPEGCached(boolean pixelsExposed) throws IOException {
        BufferedImage thumbnail = cachedThumbnail != null ? cachedThumbnail.get() : null;
 
        if (thumbnail == null) {
            thumbnail = readJPEG();
        } 
 
        cachedThumbnail = pixelsExposed ? null : new SoftReference<BufferedImage>(thumbnail);
 
        return thumbnail;
    } 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 IIOException Methods: