aweisberg commented on code in PR #2049:
URL: https://github.com/apache/cassandra/pull/2049#discussion_r1063752201


##########
src/java/org/apache/cassandra/utils/ByteBufferUtil.java:
##########
@@ -927,6 +949,19 @@ private static boolean startsWith(ByteBuffer src, 
ByteBuffer prefix, int offset)
         return true;
     }
 
+    public static <T> ByteBuffer serialized(IVersionedSerializer<T> 
serializer, T value, int version)
+    {
+        try (DataOutputBuffer dob = new DataOutputBuffer())
+        {
+            serializer.serialize(value, dob, version);
+            return dob.buffer();
+        }
+        catch (IOException e)
+        {
+            throw new RuntimeException(e);
+        }
+    }
+
     public static final IVersionedSerializer<ByteBuffer> vintSerializer = new 
IVersionedSerializer<ByteBuffer>()

Review Comment:
   Renamed to `byteBufferSerializer` and `nullableByteBufferSerializer`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to