jdk.testlibrary.IOUtils Java Examples

The following examples show how to use jdk.testlibrary.IOUtils. 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: LambdaClassLoaderSerialization.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
    String path = name.replace('.', '/').concat(".class");
    try (InputStream is = getResourceAsStream(path)) {
        if (is != null) {
            byte[] bytes = IOUtils.readFully(is);
            return defineClass(name, bytes, 0, bytes.length);
        } else {
            throw new ClassNotFoundException(name);
        }
    }
    catch (IOException e) {
        throw new ClassNotFoundException(name, e);
    }
}
 
Example #2
Source File: LambdaClassLoaderSerialization.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
    String path = name.replace('.', '/').concat(".class");
    try (InputStream is = getResourceAsStream(path)) {
        if (is != null) {
            byte[] bytes = IOUtils.readFully(is);
            return defineClass(name, bytes, 0, bytes.length);
        } else {
            throw new ClassNotFoundException(name);
        }
    }
    catch (IOException e) {
        throw new ClassNotFoundException(name, e);
    }
}
 
Example #3
Source File: LambdaClassLoaderSerialization.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
    String path = name.replace('.', '/').concat(".class");
    try (InputStream is = getResourceAsStream(path)) {
        if (is != null) {
            byte[] bytes = IOUtils.readFully(is);
            return defineClass(name, bytes, 0, bytes.length);
        } else {
            throw new ClassNotFoundException(name);
        }
    }
    catch (IOException e) {
        throw new ClassNotFoundException(name, e);
    }
}
 
Example #4
Source File: LambdaClassLoaderSerialization.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
    String path = name.replace('.', '/').concat(".class");
    try (InputStream is = getResourceAsStream(path)) {
        if (is != null) {
            byte[] bytes = IOUtils.readFully(is);
            return defineClass(name, bytes, 0, bytes.length);
        } else {
            throw new ClassNotFoundException(name);
        }
    }
    catch (IOException e) {
        throw new ClassNotFoundException(name, e);
    }
}
 
Example #5
Source File: LambdaClassLoaderSerialization.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
    String path = name.replace('.', '/').concat(".class");
    try (InputStream is = getResourceAsStream(path)) {
        if (is != null) {
            byte[] bytes = IOUtils.readFully(is);
            return defineClass(name, bytes, 0, bytes.length);
        } else {
            throw new ClassNotFoundException(name);
        }
    }
    catch (IOException e) {
        throw new ClassNotFoundException(name, e);
    }
}