Compile fix
This commit is contained in:
@@ -333,7 +333,7 @@ public class TypeIO{
|
|||||||
public static void writeString(ByteBuffer buffer, String string){
|
public static void writeString(ByteBuffer buffer, String string){
|
||||||
if(string != null){
|
if(string != null){
|
||||||
Charset charset = Charset.defaultCharset();
|
Charset charset = Charset.defaultCharset();
|
||||||
byte[] nameBytes = charset.toString().getBytes(StandardCharsets.UTF_8);
|
byte[] nameBytes = charset.name().getBytes(StandardCharsets.UTF_8);
|
||||||
buffer.put((byte)nameBytes.length);
|
buffer.put((byte)nameBytes.length);
|
||||||
buffer.put(nameBytes);
|
buffer.put(nameBytes);
|
||||||
|
|
||||||
@@ -379,7 +379,7 @@ public class TypeIO{
|
|||||||
public static void writeStringData(DataOutput buffer, String string) throws IOException{
|
public static void writeStringData(DataOutput buffer, String string) throws IOException{
|
||||||
if(string != null){
|
if(string != null){
|
||||||
Charset charset = Charset.defaultCharset();
|
Charset charset = Charset.defaultCharset();
|
||||||
byte[] nameBytes = charset.toString().getBytes(StandardCharsets.UTF_8);
|
byte[] nameBytes = charset.name().getBytes(StandardCharsets.UTF_8);
|
||||||
buffer.writeByte((byte)nameBytes.length);
|
buffer.writeByte((byte)nameBytes.length);
|
||||||
buffer.write(nameBytes);
|
buffer.write(nameBytes);
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ public class TypeIO{
|
|||||||
|
|
||||||
short slength = buffer.readShort();
|
short slength = buffer.readShort();
|
||||||
byte[] bytes = new byte[slength];
|
byte[] bytes = new byte[slength];
|
||||||
buffer.readByte(bytes);
|
buffer.readFully(bytes);
|
||||||
return new String(bytes, charset);
|
return new String(bytes, charset);
|
||||||
}else{
|
}else{
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user