Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Jan 13, 2025
1 parent 2ef1c4d commit 036bf72
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 131 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/com/alibaba/fastjson2/JSONReaderJSONB.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import static com.alibaba.fastjson2.JSONFactory.*;
import static com.alibaba.fastjson2.JSONReaderUTF8.*;
import static com.alibaba.fastjson2.util.DateUtils.*;
import static com.alibaba.fastjson2.util.IOUtils.getLongBigEndian;
import static com.alibaba.fastjson2.util.IOUtils.getLongBE;
import static com.alibaba.fastjson2.util.JDKUtils.*;
import static com.alibaba.fastjson2.util.TypeUtils.toBigDecimal;
import static java.nio.charset.StandardCharsets.ISO_8859_1;
Expand Down Expand Up @@ -5065,8 +5065,8 @@ public UUID readUUID() {
throw new JSONException("uuid not support " + len);
}
uuid = new UUID(
getLongBigEndian(bytes, offset),
getLongBigEndian(bytes, offset + 8));
getLongBE(bytes, offset),
getLongBE(bytes, offset + 8));
offset += 16;
break;
case BC_STR_ASCII_FIX_32: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6673,7 +6673,7 @@ static UUID readUUID36(byte[] bytes, int offset) {
}

static long parse4Nibbles(byte[] bytes, int offset) {
int x = getIntLittleEndian(bytes, offset);
int x = getIntLE(bytes, offset);
byte[] ns = NIBBLES;
return ns[x & 0xFF] << 12 | ns[(x >> 8) & 0xFF] << 8 | ns[(x >> 16) & 0xFF] << 4 | ns[(x >> 24) & 0xFF];
}
Expand Down
16 changes: 8 additions & 8 deletions core/src/main/java/com/alibaba/fastjson2/JSONWriterUTF16.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,13 @@ public void writeStringLatin1(byte[] value) {
final long vecQuote = this.byteVectorQuote;
final int upperBound = (value.length - i) & ~7;
for (; i < upperBound; i += 8) {
long vec64 = getLongLittleEndian(value, i);
long vec64 = getLongLE(value, i);
if (containsEscaped(vec64, vecQuote)) {
escape = true;
break;
}
IOUtils.putLong(chars, off, expand(vec64));
IOUtils.putLong(chars, off + 4, expand(vec64 >>> 32));
IOUtils.putLongLE(chars, off, expand(vec64));
IOUtils.putLongLE(chars, off + 4, expand(vec64 >>> 32));
off += 8;
}
if (!escape) {
Expand Down Expand Up @@ -372,11 +372,11 @@ public void writeStringUTF16(final byte[] value) {

final int upperBound = (char_len - i) & ~3;
for (; i < upperBound; i += 4) {
long v = getLongLittleEndian(value, i << 1);
long v = getLongLE(value, i << 1);
if (containsEscapedUTF16(v, vecQuote)) {
break;
}
IOUtils.putLong(chars, off, v);
IOUtils.putLongLE(chars, off, v);
off += 4;
}
for (; i < char_len;) {
Expand Down Expand Up @@ -2395,7 +2395,7 @@ public final void writeDateTimeISO8601(
final int rem1 = millis - div * 10;

if (rem1 != 0) {
IOUtils.putLong(chars, off, (DIGITS_K_64[millis] & 0xffffffffffff0000L) | DOT_X0);
IOUtils.putLongLE(chars, off, (DIGITS_K_64[millis] & 0xffffffffffff0000L) | DOT_X0);
off += 4;
} else {
chars[off++] = '.';
Expand Down Expand Up @@ -3094,11 +3094,11 @@ static void writeEscapedChar(char[] chars, int off, int c0) {

static void writeU4Hex2(char[] chars, int off, int c) {
IOUtils.putLongUnaligned(chars, off, U4);
IOUtils.putInt(chars, off + 4, utf16Hex2(c));
IOUtils.putIntLE(chars, off + 4, utf16Hex2(c));
}

static void writeU4HexU(char[] chars, int off, int c) {
IOUtils.putIntUnaligned(chars, off, U2);
IOUtils.putLong(chars, off + 2, utf16Hex4U(c));
IOUtils.putLongLE(chars, off + 2, utf16Hex4U(c));
}
}
6 changes: 3 additions & 3 deletions core/src/main/java/com/alibaba/fastjson2/JSONWriterUTF8.java
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ public void writeStringLatin1(byte[] value) {
int i = 0;
final int upperBound = (value.length - i) & ~7;
for (; i < upperBound; i += 8) {
if (containsEscaped(IOUtils.getLongLittleEndian(value, i), vecQuote)) {
if (containsEscaped(IOUtils.getLongLE(value, i), vecQuote)) {
break;
}
}
Expand Down Expand Up @@ -2638,7 +2638,7 @@ public final void writeDateTimeISO8601(
final int rem1 = millis - div * 10;

if (rem1 != 0) {
putInt(bytes, off, DIGITS_K_32[millis] & 0xffffff00 | '.');
putIntLE(bytes, off, DIGITS_K_32[millis] & 0xffffff00 | '.');
off += 4;
} else {
bytes[off++] = '.';
Expand Down Expand Up @@ -3001,7 +3001,7 @@ public final int flushTo(OutputStream out, Charset charset) throws IOException {
}

static void writeEscapedChar(byte[] bytes, int off, int c0) {
putShort(bytes, off, ESCAPED_CHARS[c0 & 0x7f]);
putShortLE(bytes, off, ESCAPED_CHARS[c0 & 0x7f]);
}

static void writeU4Hex2(byte[] bytes, int off, int c) {
Expand Down
Loading

0 comments on commit 036bf72

Please sign in to comment.