Skip to content

Commit acd92b8

Browse files
committed
Add a c'tor to take in charset.
InputStreamReader defaults to the locale of the container, have added a constructor to pass in the desired Charset.
1 parent bd988e3 commit acd92b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/msgpack/util/json/JSONUnpacker.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.List;
2525
import java.util.Map;
2626
import java.util.Iterator;
27+
import java.nio.charset.Charset;
2728
import org.json.simple.parser.JSONParser;
2829
import org.json.simple.parser.ParseException;
2930
import org.msgpack.MessagePack;
@@ -42,6 +43,10 @@ public JSONUnpacker(InputStream in) {
4243
public JSONUnpacker(MessagePack msgpack, InputStream in) {
4344
this(msgpack, new InputStreamReader(in));
4445
}
46+
47+
public JSONUnpacker(MessagePack msgpack, InputStream in, Charset cs) {
48+
this(msgpack, new InputStreamReader(in, cs));
49+
}
4550

4651
JSONUnpacker(MessagePack msgpack, Reader in) {
4752
super(msgpack, null);

0 commit comments

Comments
 (0)