mirror of
https://github.com/revanced/jadb.git
synced 2025-02-06 07:26:48 +01:00
Fixing a bug where strings where sometimes not read completely during sync. Removing some IntellJ warnings.
This commit is contained in:
parent
0bc737adab
commit
6b8c330195
@ -29,7 +29,7 @@ class SyncTransport {
|
||||
|
||||
private String readString(int length) throws IOException {
|
||||
byte[] buffer = new byte[length];
|
||||
input.read(buffer);
|
||||
input.readFully(buffer);
|
||||
return new String(buffer, Charset.forName("utf-8"));
|
||||
}
|
||||
|
||||
@ -38,10 +38,10 @@ class SyncTransport {
|
||||
int mode = readInt();
|
||||
int size = readInt();
|
||||
int time = readInt();
|
||||
int nameLenght = readInt();
|
||||
String name = readString(nameLenght);
|
||||
int nameLength = readInt();
|
||||
String name = readString(nameLength);
|
||||
|
||||
if ("DENT".equals(id) == false) return RemoteFile.DONE;
|
||||
if (!"DENT".equals(id)) return RemoteFile.DONE;
|
||||
return new RemoteFile(id, name, mode, size, time);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user