Implementation of #5280

This commit is contained in:
Anuken
2021-06-07 10:47:53 -04:00
parent a64efce5a0
commit 82742339a3
6 changed files with 184 additions and 77 deletions
+24
View File
@@ -588,6 +588,30 @@ public class TypeIO{
return new TraceInfo(readString(read), readString(read), read.b() == 1, read.b() == 1, read.i(), read.i());
}
public static void writeStrings(Writes write, String[][] strings){
write.b(strings.length);
for(String[] string : strings){
write.b(string.length);
for(String s : string){
writeString(write, s);
}
}
}
public static String[][] readStrings(Reads read){
int rows = read.ub();
String[][] strings = new String[rows][];
for(int i = 0; i < rows; i++){
int columns = read.ub();
strings[i] = new String[columns];
for(int j = 0; j < columns; j++){
strings[i][j] = readString(read);
}
}
return strings;
}
public static void writeStringData(DataOutput buffer, String string) throws IOException{
if(string != null){
byte[] bytes = string.getBytes(charset);