下面列出了javax.imageio.spi.ImageWriterSpi#getOutputTypes ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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!");
}
}
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!");
}
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}
/**
* 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;
}