Skip to content

Commit

Permalink
Fixed UBJSON reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Aug 30, 2024
1 parent 277a7cc commit 31a570a
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions arc-core/src/arc/util/serialization/UBJsonReader.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package arc.util.serialization;

import arc.files.Fi;
import arc.util.ArcRuntimeException;
import arc.util.Strings;
import arc.util.io.Streams;
import arc.files.*;
import arc.util.*;
import arc.util.io.*;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.*;

/**
* Lightweight UBJSON parser.<br>
Expand All @@ -17,7 +14,6 @@
* @author Xoppa
*/
public class UBJsonReader implements BaseJsonReader{
public boolean oldFormat = true;

/**
* Parses the UBJSON from the given stream. <br>
Expand Down Expand Up @@ -69,15 +65,15 @@ else if(type == 'T')
else if(type == 'F')
return new JsonValue(false);
else if(type == 'B')
return new JsonValue((long)readUChar(din));
return new JsonValue(readUChar(din));
else if(type == 'U')
return new JsonValue((long)readUChar(din));
return new JsonValue(readUChar(din));
else if(type == 'i')
return new JsonValue(oldFormat ? (long)din.readShort() : (long)din.readByte());
return new JsonValue(din.readByte());
else if(type == 'I')
return new JsonValue(oldFormat ? (long)din.readInt() : (long)din.readShort());
return new JsonValue(din.readShort());
else if(type == 'l')
return new JsonValue((long)din.readInt());
return new JsonValue(din.readInt());
else if(type == 'L')
return new JsonValue(din.readLong());
else if(type == 'd')
Expand Down

0 comments on commit 31a570a

Please sign in to comment.