Skip to content

Commit 2c91e1e

Browse files
javachefacebook-github-bot
authored andcommitted
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
1 parent c3982b6 commit 2c91e1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/fb/src/main/cpp/jni/ByteBuffer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ local_ref<JByteBuffer> JByteBuffer::wrapBytes(uint8_t* data, size_t size) {
3939
return res;
4040
}
4141

42-
uint8_t* JByteBuffer::getDirectBytes() {
42+
uint8_t* JByteBuffer::getDirectBytes() const {
4343
if (!self()) {
4444
throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException");
4545
}
@@ -54,7 +54,7 @@ uint8_t* JByteBuffer::getDirectBytes() {
5454
return static_cast<uint8_t*>(bytes);
5555
}
5656

57-
size_t JByteBuffer::getDirectSize() {
57+
size_t JByteBuffer::getDirectSize() const {
5858
if (!self()) {
5959
throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException");
6060
}
@@ -69,7 +69,7 @@ size_t JByteBuffer::getDirectSize() {
6969
return static_cast<size_t>(size);
7070
}
7171

72-
bool JByteBuffer::isDirect() {
72+
bool JByteBuffer::isDirect() const {
7373
static auto meth = javaClassStatic()->getMethod<jboolean()>("isDirect");
7474
return meth(self());
7575
}

0 commit comments

Comments
 (0)