Skip to content

Commit

Permalink
fix merge issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed May 19, 2024
1 parent fe466d6 commit d210993
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ object ByteStringEncoder extends Encoder[String] :
*/
object FixedStringEncoder extends Encoder[String] :
override def encode(schema: Schema): String => Any = string =>
val bytes = string.getBytes(StandardCharsets.UTF_8)
if (bytes.length > schema.getFixedSize)
throw new Avro4sEncodingException(s"Cannot write string with ${bytes.length} bytes to fixed type of size ${schema.getFixedSize}")
GenericData.get.createFixed(null, ByteBuffer.allocate(schema.getFixedSize).put(bytes).array, schema).asInstanceOf[GenericData.Fixed]
val bytes = string.getBytes(StandardCharsets.UTF_8)
if (bytes.length > schema.getFixedSize)
throw new Avro4sEncodingException(s"Cannot write string with ${bytes.length} bytes to fixed type of size ${schema.getFixedSize}")
Expand Down

0 comments on commit d210993

Please sign in to comment.