Skip to content

Commit

Permalink
Mark ByteBuffer methods as const
Browse files Browse the repository at this point in the history
Summary: So I can use them from JSBigString whose methods are marked const.

Reviewed By: emilsjolander

Differential Revision: D5020648

fbshipit-source-id: 6e60b80cb3d4718bab25dd6ca9627aee862117db
  • Loading branch information
javache authored and facebook-github-bot committed May 10, 2017
1 parent c3982b6 commit 2c91e1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/fb/src/main/cpp/jni/ByteBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ local_ref<JByteBuffer> 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");
}
Expand All @@ -54,7 +54,7 @@ uint8_t* JByteBuffer::getDirectBytes() {
return static_cast<uint8_t*>(bytes);
}

size_t JByteBuffer::getDirectSize() {
size_t JByteBuffer::getDirectSize() const {
if (!self()) {
throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException");
}
Expand All @@ -69,7 +69,7 @@ size_t JByteBuffer::getDirectSize() {
return static_cast<size_t>(size);
}

bool JByteBuffer::isDirect() {
bool JByteBuffer::isDirect() const {
static auto meth = javaClassStatic()->getMethod<jboolean()>("isDirect");
return meth(self());
}
Expand Down

0 comments on commit 2c91e1e

Please sign in to comment.