mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-13 00:04:29 +00:00
[Java] Replace Table.UTF8_CHARSET with StandardCharsets.UTF_8 (#5696)
StandardCharsets.UTF_8 is already used in FlexBuffersBuilder.
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
3b458f7a17
commit
35daaf83d3
@@ -1134,7 +1134,7 @@ class JavaGenerator : public BaseGenerator {
|
||||
code += " key, ByteBuffer bb) {\n";
|
||||
if (key_field->value.type.base_type == BASE_TYPE_STRING) {
|
||||
code += " byte[] byteKey = ";
|
||||
code += "key.getBytes(Table.UTF8_CHARSET.get());\n";
|
||||
code += "key.getBytes(java.nio.charset.StandardCharsets.UTF_8);\n";
|
||||
}
|
||||
code += " int span = ";
|
||||
code += "bb.getInt(vectorLocation - 4);\n";
|
||||
|
||||
@@ -522,7 +522,7 @@ class KotlinGenerator : public BaseGenerator {
|
||||
if (base_type == BASE_TYPE_STRING) {
|
||||
writer +=
|
||||
"val byteKey = key."
|
||||
"toByteArray(Table.UTF8_CHARSET.get()!!)";
|
||||
"toByteArray(java.nio.charset.StandardCharsets.UTF_8)";
|
||||
}
|
||||
writer += "var span = bb.getInt(vectorLocation - 4)";
|
||||
writer += "var start = 0";
|
||||
|
||||
Reference in New Issue
Block a user