Skip to content

Commit b6b52db

Browse files
committed
[ delete] del readableBytes
1 parent 76a43c8 commit b6b52db

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

core/src/main/java/com/qq/tars/protocol/tars/TarsInputStream.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ public boolean skipToTag(int tag) {
103103
try {
104104
HeadData hd = new HeadData();
105105
while (true) {
106-
if(bs.readableBytes()==0){
107-
return false;
108-
}
109106
int len = peakHead(hd);
110107
if (hd.type == TarsStructBase.STRUCT_END) {
111108
return false;
@@ -904,10 +901,11 @@ public int setServerEncoding(Charset se) {
904901

905902

906903
public ByteBuf getBs() {
907-
return this.bs;
904+
return this.bs;
908905
}
906+
909907
public byte[] toByteArray() {
910-
final byte[] byteArrays =new byte[bs.readableBytes()];
908+
final byte[] byteArrays = new byte[bs.readableBytes()];
911909
bs.readBytes(byteArrays);
912910
return byteArrays;
913911
}

0 commit comments

Comments
 (0)