From 2c91e1e7d2d03853c11e99a4e773a93515d4e56b Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Wed, 10 May 2017 04:26:09 -0700 Subject: [PATCH] Mark ByteBuffer methods as const Summary: So I can use them from JSBigString whose methods are marked const. Reviewed By: emilsjolander Differential Revision: D5020648 fbshipit-source-id: 6e60b80cb3d4718bab25dd6ca9627aee862117db --- lib/fb/src/main/cpp/jni/ByteBuffer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/fb/src/main/cpp/jni/ByteBuffer.cpp b/lib/fb/src/main/cpp/jni/ByteBuffer.cpp index b95ae4a1..2e839ecf 100644 --- a/lib/fb/src/main/cpp/jni/ByteBuffer.cpp +++ b/lib/fb/src/main/cpp/jni/ByteBuffer.cpp @@ -39,7 +39,7 @@ local_ref JByteBuffer::wrapBytes(uint8_t* data, size_t size) { return res; } -uint8_t* JByteBuffer::getDirectBytes() { +uint8_t* JByteBuffer::getDirectBytes() const { if (!self()) { throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException"); } @@ -54,7 +54,7 @@ uint8_t* JByteBuffer::getDirectBytes() { return static_cast(bytes); } -size_t JByteBuffer::getDirectSize() { +size_t JByteBuffer::getDirectSize() const { if (!self()) { throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException"); } @@ -69,7 +69,7 @@ size_t JByteBuffer::getDirectSize() { return static_cast(size); } -bool JByteBuffer::isDirect() { +bool JByteBuffer::isDirect() const { static auto meth = javaClassStatic()->getMethod("isDirect"); return meth(self()); }