Update RedisInputStream.java

Fix code style
This commit is contained in:
Dambar Pun 2021-07-03 10:00:32 +08:00 committed by Ehren Kret
parent 12e11609a9
commit a96865d0f5
1 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ public class RedisInputStream {
} }
public String readLine() throws IOException { public String readLine() throws IOException {
ByteArrayOutputStream boas = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
boolean foundCr = false; boolean foundCr = false;
@ -31,14 +31,14 @@ public class RedisInputStream {
throw new IOException("Stream closed!"); throw new IOException("Stream closed!");
} }
boas.write(character); baos.write(character);
if (foundCr && character == LF) break; if (foundCr && character == LF) break;
else if (character == CR) foundCr = true; else if (character == CR) foundCr = true;
else if (foundCr) foundCr = false; else if (foundCr) foundCr = false;
} }
byte[] data = boas.toByteArray(); byte[] data = baos.toByteArray();
return new String(data, 0, data.length-2); return new String(data, 0, data.length-2);
} }