From 7b9b1ce6e6f1290340f597d0ae2880f5b0dc2872 Mon Sep 17 00:00:00 2001 From: Dave Cromberge Date: Fri, 7 Aug 2015 16:01:28 +0100 Subject: [PATCH] minor documentation fix to StringDecoder --- core/src/main/scala/kafka/serializer/Decoder.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/scala/kafka/serializer/Decoder.scala b/core/src/main/scala/kafka/serializer/Decoder.scala index 54d0b935704ae..164c3fa419c03 100644 --- a/core/src/main/scala/kafka/serializer/Decoder.scala +++ b/core/src/main/scala/kafka/serializer/Decoder.scala @@ -5,7 +5,7 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software @@ -36,16 +36,16 @@ class DefaultDecoder(props: VerifiableProperties = null) extends Decoder[Array[B } /** - * The string encoder translates strings into bytes. It uses UTF8 by default but takes + * The string decoder translates bytes into strings. It uses UTF8 by default but takes * an optional property serializer.encoding to control this. */ class StringDecoder(props: VerifiableProperties = null) extends Decoder[String] { - val encoding = + val encoding = if(props == null) - "UTF8" + "UTF8" else props.getString("serializer.encoding", "UTF8") - + def fromBytes(bytes: Array[Byte]): String = { new String(bytes, encoding) }