Skip to content

Commit

Permalink
redis 7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Baoyi Chen committed Feb 4, 2022
1 parent 21cfc8c commit 7f93fba
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public Object parse(BulkReplyHandler handler) throws IOException {
switch (c) {
case DOLLAR:
// RESP Bulk Strings
ByteBuilder builder = ByteBuilder.allocate(128);
ByteBuilder builder = ByteBuilder.allocate(32);
while (true) {
while ((c = in.read()) != '\r') {
builder.put((byte) c);
Expand Down Expand Up @@ -104,7 +104,7 @@ public Object parse(BulkReplyHandler handler) throws IOException {
throw new AssertionError("Callback is null");
case COLON:
// RESP Integers
builder = ByteBuilder.allocate(128);
builder = ByteBuilder.allocate(32);
while (true) {
while ((c = in.read()) != '\r') {
builder.put((byte) c);
Expand All @@ -119,7 +119,7 @@ public Object parse(BulkReplyHandler handler) throws IOException {
return Long.parseLong(builder.toString());
case STAR:
// RESP Arrays
builder = ByteBuilder.allocate(128);
builder = ByteBuilder.allocate(32);
while (true) {
while ((c = in.read()) != '\r') {
builder.put((byte) c);
Expand All @@ -140,7 +140,7 @@ public Object parse(BulkReplyHandler handler) throws IOException {
return ary;
case PLUS:
// RESP Simple Strings
builder = ByteBuilder.allocate(128);
builder = ByteBuilder.allocate(64);
while (true) {
while ((c = in.read()) != '\r') {
builder.put((byte) c);
Expand All @@ -153,7 +153,7 @@ public Object parse(BulkReplyHandler handler) throws IOException {
}
case MINUS:
// RESP Errors
builder = ByteBuilder.allocate(128);
builder = ByteBuilder.allocate(64);
while (true) {
while ((c = in.read()) != '\r') {
builder.put((byte) c);
Expand All @@ -166,7 +166,7 @@ public Object parse(BulkReplyHandler handler) throws IOException {
}
case HASHTAG:
// #TS:${timestamp}\r\n
builder = ByteBuilder.allocate(128);
builder = ByteBuilder.allocate(32);
while (true) {
while ((c = in.read()) != '\r') {
builder.put((byte) c);
Expand Down

0 comments on commit 7f93fba

Please sign in to comment.