| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 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 |