mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-07 07:40:55 +03:00
Code formatting improvements.
This commit is contained in:
@@ -132,8 +132,9 @@ public class Buffer<T extends Buffer<T>> {
|
|||||||
|
|
||||||
protected void ensureAvailable(int a)
|
protected void ensureAvailable(int a)
|
||||||
throws BufferException {
|
throws BufferException {
|
||||||
if (available() < a)
|
if (available() < a) {
|
||||||
throw new BufferException("Underflow");
|
throw new BufferException("Underflow");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ensureCapacity(int capacity) {
|
public void ensureCapacity(int capacity) {
|
||||||
@@ -392,8 +393,9 @@ public class Buffer<T extends Buffer<T>> {
|
|||||||
public String readString(Charset cs)
|
public String readString(Charset cs)
|
||||||
throws BufferException {
|
throws BufferException {
|
||||||
int len = readUInt32AsInt();
|
int len = readUInt32AsInt();
|
||||||
if (len < 0 || len > 32768)
|
if (len < 0 || len > 32768) {
|
||||||
throw new BufferException("Bad item length: " + len);
|
throw new BufferException("Bad item length: " + len);
|
||||||
|
}
|
||||||
ensureAvailable(len);
|
ensureAvailable(len);
|
||||||
String s = new String(data, rpos, len, cs);
|
String s = new String(data, rpos, len, cs);
|
||||||
rpos += len;
|
rpos += len;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class IOUtils {
|
|||||||
if (c != null)
|
if (c != null)
|
||||||
c.close();
|
c.close();
|
||||||
} catch (IOException logged) {
|
} catch (IOException logged) {
|
||||||
loggerFactory.getLogger(IOUtils.class).warn("Error closing {} - {}", c, logged);
|
loggerFactory.getLogger(IOUtils.class).warn("Error closing {} - {}", c, logged);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user