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
This commit is contained in:
Pieter De Baets
2017-05-10 04:26:09 -07:00
committed by Facebook Github Bot
parent c3982b6c1e
commit 2c91e1e7d2

View File

@@ -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");
}
@@ -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");
}
@@ -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());
}