mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
30.42.2012 7934d276c1dfdc3224c391c23f574d244c5b0a10
opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/util/StaticUtils.java
@@ -30,6 +30,8 @@
import static org.forgerock.opendj.ldap.CoreMessages.ERR_HEX_DECODE_INVALID_CHARACTER;
import static org.forgerock.opendj.ldap.CoreMessages.ERR_HEX_DECODE_INVALID_LENGTH;
import java.io.Closeable;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@@ -1144,6 +1146,24 @@
    }
    /**
     * Closes the provided resources ignoring any errors which occurred.
     *
     * @param resources
     *            The resources to be closed, which may be {@code null}.
     */
    public static void closeSilently(Closeable... resources) {
        for (Closeable r : resources) {
            try {
                if (r != null) {
                    r.close();
                }
            } catch (IOException ignored) {
                // Ignore.
            }
        }
    }
    /**
     * Attempts to compress the data in the provided source array into the given
     * destination array. If the compressed data will fit into the destination
     * array, then this method will return the number of bytes of compressed