src/main/java/org/beykery/jkcp/Kcp.java
public int peekSize() {
        if (rcv_queue.isEmpty()) {
            return -1;
        }
        Segment seq = rcv_queue.getFirst();
        if (seq.frg == 0) {
            return seq.data.readableBytes();
        }
        if (rcv_queue.size() < seq.frg + 1) {
            return -1;
        }
        int length = 0;
        for (Segment item : rcv_queue) {
            length += item.data.readableBytes();
            if (item.frg == 0) {
                break;
            }
        }
        return length;
    }
/**
     * check the size of next message in the recv queue
     *
     * @return
     */
check the size of next message in the recv queue
@return
check the size of next message in the recv queue @return
public int peekSize() {
        if (rcv_queue.isEmpty()) {
            return -1;
        }
        Segment seq = rcv_queue.getFirst();
        if (seq.frg == 0) {
            return seq.data.readableBytes();
        }
        if (rcv_queue.size() < seq.frg + 1) {
            return -1;
        }
        int length = 0;
        for (Segment item : rcv_queue) {
            length += item.data.readableBytes();
            if (item.frg == 0) {
                break;
            }
        }
        return length;
    }
public int peekSize ( ) { if ( rcv_queue . isEmpty ( ) ) { return - 1 ; } Segment seq = rcv_queue . getFirst ( ) ; if ( seq . frg == 0 ) { return seq . data . readableBytes ( ) ; } if ( rcv_queue . size ( ) < seq . frg + 1 ) { return - 1 ; } int length = 0 ; for ( Segment item : rcv_queue ) { length += item . data . readableBytes ( ) ; if ( item . frg == 0 ) { break ; } } return length ; }
check the size of next message in the recv queue
 @return
check the size of next message in the recv queue @return