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:
committed by
Facebook Github Bot
parent
c3982b6c1e
commit
2c91e1e7d2
@@ -39,7 +39,7 @@ local_ref<JByteBuffer> JByteBuffer::wrapBytes(uint8_t* data, size_t size) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t* JByteBuffer::getDirectBytes() {
|
uint8_t* JByteBuffer::getDirectBytes() const {
|
||||||
if (!self()) {
|
if (!self()) {
|
||||||
throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException");
|
throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException");
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ uint8_t* JByteBuffer::getDirectBytes() {
|
|||||||
return static_cast<uint8_t*>(bytes);
|
return static_cast<uint8_t*>(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t JByteBuffer::getDirectSize() {
|
size_t JByteBuffer::getDirectSize() const {
|
||||||
if (!self()) {
|
if (!self()) {
|
||||||
throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException");
|
throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException");
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@ size_t JByteBuffer::getDirectSize() {
|
|||||||
return static_cast<size_t>(size);
|
return static_cast<size_t>(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JByteBuffer::isDirect() {
|
bool JByteBuffer::isDirect() const {
|
||||||
static auto meth = javaClassStatic()->getMethod<jboolean()>("isDirect");
|
static auto meth = javaClassStatic()->getMethod<jboolean()>("isDirect");
|
||||||
return meth(self());
|
return meth(self());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user