mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-08 00:00:54 +03:00
Code formatting improvements.
This commit is contained in:
@@ -132,9 +132,10 @@ public class Buffer<T extends Buffer<T>> {
|
||||
|
||||
protected void ensureAvailable(int a)
|
||||
throws BufferException {
|
||||
if (available() < a)
|
||||
if (available() < a) {
|
||||
throw new BufferException("Underflow");
|
||||
}
|
||||
}
|
||||
|
||||
public void ensureCapacity(int capacity) {
|
||||
if (data.length - wpos < capacity) {
|
||||
@@ -392,8 +393,9 @@ public class Buffer<T extends Buffer<T>> {
|
||||
public String readString(Charset cs)
|
||||
throws BufferException {
|
||||
int len = readUInt32AsInt();
|
||||
if (len < 0 || len > 32768)
|
||||
if (len < 0 || len > 32768) {
|
||||
throw new BufferException("Bad item length: " + len);
|
||||
}
|
||||
ensureAvailable(len);
|
||||
String s = new String(data, rpos, len, cs);
|
||||
rpos += len;
|
||||
|
||||
Reference in New Issue
Block a user