#100 Various methods can be made less accessible to increase encapsulation

This commit is contained in:
Mieras Made 2018-09-11 20:15:06 +02:00
parent 6c84fe6542
commit 93101d290b
4 changed files with 5 additions and 5 deletions

View File

@ -19,7 +19,7 @@ public class DeviceWatcher implements Runnable {
}
@SuppressWarnings("squid:S2189") // watcher is stopped by closing transport
public void watch() {
private void watch() {
try {
while (true) {
listener.onDetect(connection.parseDevices(transport.readString()));

View File

@ -45,11 +45,11 @@ public class SyncTransport {
}
}
public int readInt() throws IOException {
private int readInt() throws IOException {
return Integer.reverseBytes(input.readInt());
}
public String readString(int length) throws IOException {
private String readString(int length) throws IOException {
byte[] buffer = new byte[length];
input.readFully(buffer);
return new String(buffer, StandardCharsets.UTF_8);

View File

@ -47,7 +47,7 @@ class Transport {
return new String(responseBuffer, StandardCharsets.UTF_8);
}
public String getCommandLength(String command) {
private String getCommandLength(String command) {
return String.format("%04x", command.length());
}

View File

@ -211,7 +211,7 @@ class AdbProtocolHandler implements Runnable {
return String.format("%04x", command.length());
}
public void send(DataOutput writer, String response) throws IOException {
private void send(DataOutput writer, String response) throws IOException {
writer.writeBytes(getCommandLength(response));
writer.writeBytes(response);
}