From 3384638f67ebb7895dd095433d1380dde0b40f3d Mon Sep 17 00:00:00 2001
From: Yannick Lecaillez <yannick.lecaillez@forgerock.com>
Date: Mon, 07 Nov 2016 13:59:40 +0000
Subject: [PATCH] OPENDJ-3179: Migrate LDAP Connection Handler to SDK Grizzly transport

---
 opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ASN1BufferReader.java |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ASN1BufferReader.java b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ASN1BufferReader.java
index 2618456..87d9905 100644
--- a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ASN1BufferReader.java
+++ b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ASN1BufferReader.java
@@ -20,6 +20,7 @@
 
 import java.io.IOException;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 
 import org.forgerock.i18n.LocalizableMessage;
 import org.forgerock.i18n.slf4j.LocalizedLogger;
@@ -137,14 +138,14 @@
     private SequenceLimiter readLimiter;
 
     /**
-     * Creates a new ASN1 reader whose source is the provided input stream and
+     * Creates a new ASN1 reader whose source is the provided buffer and
      * having a user defined maximum BER element size.
      *
      * @param maxElementSize
      *            The maximum BER element size, or <code>0</code> to indicate
      *            that there is no limit.
-     * @param memoryManager
-     *            The memory manager to use for buffering.
+     * @param buffer
+     *            The buffer where the content will be read from.
      */
     ASN1BufferReader(final int maxElementSize, final Buffer buffer) {
         this.readLimiter = new RootSequenceLimiter();
@@ -392,7 +393,7 @@
 
         String str;
         try {
-            str = buffer.toStringContent(Charset.forName("UTF-8"), buffer.position(), buffer.position() + peekLength);
+            str = buffer.toStringContent(StandardCharsets.UTF_8, buffer.position(), buffer.position() + peekLength);
         } catch (final Exception e) {
             // TODO: I18N
             logger.warn(LocalizableMessage.raw("Unable to decode ASN.1 OCTETSTRING bytes as UTF-8 string: %s", e));

--
Gitblit v1.10.0