javax.imageio.spi.ImageWriterSpi#getOutputTypes ( )源码实例Demo

下面列出了javax.imageio.spi.ImageWriterSpi#getOutputTypes ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openjdk-jdk9   文件: SpiTest.java
public void testSpi(ImageWriterSpi spi) {
    testSpi((ImageReaderWriterSpi)spi);
    Class[] outputTypes = spi.getOutputTypes();
    if (outputTypes == null) {
        error("outputTypes == null!");
    }
    if (outputTypes.length == 0) {
        error("outputTypes.length == 0!");
    }
    String[] readerSpiNames = spi.getImageReaderSpiNames();
    if (readerSpiNames != null && readerSpiNames.length == 0) {
        error("readerSpiNames.length == 0!");
    }
}
 
源代码2 项目: jdk8u_jdk   文件: SpiTest.java
public void testSpi(ImageWriterSpi spi) {
    testSpi((ImageReaderWriterSpi)spi);
    Class[] outputTypes = spi.getOutputTypes();
    if (outputTypes == null) {
        error("outputTypes == null!");
    }
    if (outputTypes.length == 0) {
        error("outputTypes.length == 0!");
    }
    String[] readerSpiNames = spi.getImageReaderSpiNames();
    if (readerSpiNames != null && readerSpiNames.length == 0) {
        error("readerSpiNames.length == 0!");
    }
}
 
源代码3 项目: jdk1.8-source-analysis   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码4 项目: dragonwell8_jdk   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码5 项目: TencentKona-8   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码6 项目: jdk8u60   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码7 项目: JDKSourceCode1.8   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码8 项目: openjdk-jdk8u   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码9 项目: openjdk-jdk8u-backup   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码10 项目: Bytecoder   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * {@code ImageOutputStream} or other {@code Object}.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If {@code output} is
 * {@code null}, any currently set output will be removed.
 *
 * <p> If {@code output} is an
 * {@code ImageOutputStream}, calls to the
 * {@code write}, {@code writeToSequence}, and
 * {@code prepareWriteEmpty}/{@code endWriteEmpty}
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as {@code writeInsert},
 * {@code replaceStreamMetadata},
 * {@code replaceImageMetadata}, {@code replacePixels},
 * {@code prepareInsertEmpty}/{@code endInsertEmpty},
 * and {@code endWriteSequence}, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general {@code Object} other than an
 * {@code ImageOutputStream} is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's {@code getOutputTypes} method; most writers
 * will return a single-element array containing only
 * {@code ImageOutputStream.class} to indicate that they
 * accept only an {@code ImageOutputStream}.
 *
 * <p> The default implementation sets the {@code output}
 * instance variable to the value of {@code output} after
 * checking {@code output} against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the {@code ImageOutputStream} or other
 * {@code Object} to use for future writing.
 *
 * @exception IllegalArgumentException if {@code output} is
 * not an instance of one of the classes returned by the
 * originating service provider's {@code getOutputTypes}
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class<?>[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码11 项目: openjdk-jdk9   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * {@code ImageOutputStream} or other {@code Object}.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If {@code output} is
 * {@code null}, any currently set output will be removed.
 *
 * <p> If {@code output} is an
 * {@code ImageOutputStream}, calls to the
 * {@code write}, {@code writeToSequence}, and
 * {@code prepareWriteEmpty}/{@code endWriteEmpty}
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as {@code writeInsert},
 * {@code replaceStreamMetadata},
 * {@code replaceImageMetadata}, {@code replacePixels},
 * {@code prepareInsertEmpty}/{@code endInsertEmpty},
 * and {@code endWriteSequence}, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general {@code Object} other than an
 * {@code ImageOutputStream} is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's {@code getOutputTypes} method; most writers
 * will return a single-element array containing only
 * {@code ImageOutputStream.class} to indicate that they
 * accept only an {@code ImageOutputStream}.
 *
 * <p> The default implementation sets the {@code output}
 * instance variable to the value of {@code output} after
 * checking {@code output} against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the {@code ImageOutputStream} or other
 * {@code Object} to use for future writing.
 *
 * @exception IllegalArgumentException if {@code output} is
 * not an instance of one of the classes returned by the
 * originating service provider's {@code getOutputTypes}
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class<?>[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码12 项目: jdk8u-jdk   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码13 项目: Java8CN   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码14 项目: hottub   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码15 项目: openjdk-8-source   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码16 项目: openjdk-8   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码17 项目: jdk8u_jdk   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码18 项目: jdk8u-jdk   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}
 
源代码19 项目: jdk8u-dev-jdk   文件: ImageWriter.java
/**
 * Sets the destination to the given
 * <code>ImageOutputStream</code> or other <code>Object</code>.
 * The destination is assumed to be ready to accept data, and will
 * not be closed at the end of each write. This allows distributed
 * imaging applications to transmit a series of images over a
 * single network connection.  If <code>output</code> is
 * <code>null</code>, any currently set output will be removed.
 *
 * <p> If <code>output</code> is an
 * <code>ImageOutputStream</code>, calls to the
 * <code>write</code>, <code>writeToSequence</code>, and
 * <code>prepareWriteEmpty</code>/<code>endWriteEmpty</code>
 * methods will preserve the existing contents of the stream.
 * Other write methods, such as <code>writeInsert</code>,
 * <code>replaceStreamMetadata</code>,
 * <code>replaceImageMetadata</code>, <code>replacePixels</code>,
 * <code>prepareInsertEmpty</code>/<code>endInsertEmpty</code>,
 * and <code>endWriteSequence</code>, require the full contents
 * of the stream to be readable and writable, and may alter any
 * portion of the stream.
 *
 * <p> Use of a general <code>Object</code> other than an
 * <code>ImageOutputStream</code> is intended for writers that
 * interact directly with an output device or imaging protocol.
 * The set of legal classes is advertised by the writer's service
 * provider's <code>getOutputTypes</code> method; most writers
 * will return a single-element array containing only
 * <code>ImageOutputStream.class</code> to indicate that they
 * accept only an <code>ImageOutputStream</code>.
 *
 * <p> The default implementation sets the <code>output</code>
 * instance variable to the value of <code>output</code> after
 * checking <code>output</code> against the set of classes
 * advertised by the originating provider, if there is one.
 *
 * @param output the <code>ImageOutputStream</code> or other
 * <code>Object</code> to use for future writing.
 *
 * @exception IllegalArgumentException if <code>output</code> is
 * not an instance of one of the classes returned by the
 * originating service provider's <code>getOutputTypes</code>
 * method.
 *
 * @see #getOutput
 */
public void setOutput(Object output) {
    if (output != null) {
        ImageWriterSpi provider = getOriginatingProvider();
        if (provider != null) {
            Class[] classes = provider.getOutputTypes();
            boolean found = false;
            for (int i = 0; i < classes.length; i++) {
                if (classes[i].isInstance(output)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                throw new IllegalArgumentException("Illegal output type!");
            }
        }
    }

    this.output = output;
}