Mark ByteBuffer methods as 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 885856c6a1
commit 567015fa04
2 changed files with 6 additions and 6 deletions

View File

@@ -25,10 +25,10 @@ class FBEXPORT JByteBuffer : public JavaClass<JByteBuffer> {
static local_ref<JByteBuffer> wrapBytes(uint8_t* data, size_t size);
bool isDirect();
bool isDirect() const;
uint8_t* getDirectBytes();
size_t getDirectSize();
uint8_t* getDirectBytes() const;
size_t getDirectSize() const;
};
}}

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