javax.imageio.spi.ImageInputStreamSpi Java Examples

The following examples show how to use javax.imageio.spi.ImageInputStreamSpi. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NullStreamCheckTest.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws IOException,
                                              MalformedURLException {

    /* deregister ImageOutputStreamSpi so that we creatImageOutputStream
     * returns null while writing.
     */
    localRegistry.deregisterAll(ImageOutputStreamSpi.class);
    /* verify possible ImageIO.write() scenario's for null stream output
     * from createImageOutputStream() API in ImageIO class.
     */
    verifyFileWrite();
    verifyStreamWrite();

    /* deregister ImageInputStreamSpi so that we creatImageInputStream
     * returns null while reading.
     */
    localRegistry.deregisterAll(ImageInputStreamSpi.class);
    /* verify possible ImageIO.read() scenario's for null stream output
     * from createImageInputStream API in ImageIO class.
     */
    verifyFileRead();
    verifyStreamRead();
    verifyUrlRead();
}
 
Example #2
Source File: NullStreamCheckTest.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws IOException,
                                              MalformedURLException {

    /* deregister ImageOutputStreamSpi so that we creatImageOutputStream
     * returns null while writing.
     */
    localRegistry.deregisterAll(ImageOutputStreamSpi.class);
    /* verify possible ImageIO.write() scenario's for null stream output
     * from createImageOutputStream() API in ImageIO class.
     */
    verifyFileWrite();
    verifyStreamWrite();

    /* deregister ImageInputStreamSpi so that we creatImageInputStream
     * returns null while reading.
     */
    localRegistry.deregisterAll(ImageInputStreamSpi.class);
    /* verify possible ImageIO.read() scenario's for null stream output
     * from createImageInputStream API in ImageIO class.
     */
    verifyFileRead();
    verifyStreamRead();
    verifyUrlRead();
}
 
Example #3
Source File: NullStreamCheckTest.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws IOException,
                                              MalformedURLException {

    /* deregister ImageOutputStreamSpi so that we creatImageOutputStream
     * returns null while writing.
     */
    localRegistry.deregisterAll(ImageOutputStreamSpi.class);
    /* verify possible ImageIO.write() scenario's for null stream output
     * from createImageOutputStream() API in ImageIO class.
     */
    verifyFileWrite();
    verifyStreamWrite();

    /* deregister ImageInputStreamSpi so that we creatImageInputStream
     * returns null while reading.
     */
    localRegistry.deregisterAll(ImageInputStreamSpi.class);
    /* verify possible ImageIO.read() scenario's for null stream output
     * from createImageInputStream API in ImageIO class.
     */
    verifyFileRead();
    verifyStreamRead();
    verifyUrlRead();
}
 
Example #4
Source File: NullStreamCheckTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws IOException,
                                              MalformedURLException {

    /* deregister ImageOutputStreamSpi so that we creatImageOutputStream
     * returns null while writing.
     */
    localRegistry.deregisterAll(ImageOutputStreamSpi.class);
    /* verify possible ImageIO.write() scenario's for null stream output
     * from createImageOutputStream() API in ImageIO class.
     */
    verifyFileWrite();
    verifyStreamWrite();

    /* deregister ImageInputStreamSpi so that we creatImageInputStream
     * returns null while reading.
     */
    localRegistry.deregisterAll(ImageInputStreamSpi.class);
    /* verify possible ImageIO.read() scenario's for null stream output
     * from createImageInputStream API in ImageIO class.
     */
    verifyFileRead();
    verifyStreamRead();
    verifyUrlRead();
}
 
Example #5
Source File: NullStreamCheckTest.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws IOException,
                                              MalformedURLException {

    /* deregister ImageOutputStreamSpi so that we creatImageOutputStream
     * returns null while writing.
     */
    localRegistry.deregisterAll(ImageOutputStreamSpi.class);
    /* verify possible ImageIO.write() scenario's for null stream output
     * from createImageOutputStream() API in ImageIO class.
     */
    verifyFileWrite();
    verifyStreamWrite();

    /* deregister ImageInputStreamSpi so that we creatImageInputStream
     * returns null while reading.
     */
    localRegistry.deregisterAll(ImageInputStreamSpi.class);
    /* verify possible ImageIO.read() scenario's for null stream output
     * from createImageInputStream API in ImageIO class.
     */
    verifyFileRead();
    verifyStreamRead();
    verifyUrlRead();
}
 
Example #6
Source File: ServiceRegistrySyncTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws InterruptedException {

        final ArrayList<Class<?>> services = new ArrayList<Class<?>>();
        services.add(ImageInputStreamSpi.class);

        final ServiceRegistry reg = new ServiceRegistry(services.iterator());

        //create new thread for Registerer and Consumer Class
        Thread registerer = new Thread(new Registerer(reg));
        Thread consumer = new Thread(new Consumer(reg));

        //run both registerer and consumer thread parallely
        registerer.start();
        consumer.start();
    }
 
Example #7
Source File: ServiceRegistrySyncTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run() {
    start = System.currentTimeMillis();
    end = start + duration;
    while (start < end) {
        //access the ServiceProvider API
        reg.getServiceProviders(ImageInputStreamSpi.class, true);
        start = System.currentTimeMillis();
    }
}