larksuite-oapi/src/main/java/com/larksuite/oapi/okhttp3_14/internal/ws/WebSocketReader.java
private void readMessage() throws IOException {
    while (true) {
      if (closed) throw new IOException("closed");

      if (frameLength > 0) {
        source.readFully(messageFrameBuffer, frameLength);

        if (!isClient) {
          messageFrameBuffer.readAndWriteUnsafe(maskCursor);
          maskCursor.seek(messageFrameBuffer.size() - frameLength);
          toggleMask(maskCursor, maskKey);
          maskCursor.close();
        }
      }

      if (isFinalFrame) break; // We are exhausted and have no continuations.

      readUntilNonControlFrame();
      if (opcode != OPCODE_CONTINUATION) {
        throw new ProtocolException("Expected continuation opcode. Got: " + toHexString(opcode));
      }
    }
  }
/**
   * Reads a message body into across one or more frames. Control frames that occur between
   * fragments will be processed. If the message payload is masked this will unmask as it's being
   * processed.
   */
Reads a message body into across one or more frames. Control frames that occur between
fragments will be processed. If the message payload is masked this will unmask as it's being
processed.
Reads a message body into across one or more frames . Control frames that occur between fragments will be processed . If the message payload is masked this will unmask as it ' s being processed .
private void readMessage() throws IOException {
    while (true) {
      if (closed) throw new IOException("closed");
      if (frameLength > 0) {
        source.readFully(messageFrameBuffer, frameLength);
        if (!isClient) {
          messageFrameBuffer.readAndWriteUnsafe(maskCursor);
          maskCursor.seek(messageFrameBuffer.size() - frameLength);
          toggleMask(maskCursor, maskKey);
          maskCursor.close();
        }
      }
      if (isFinalFrame) break; 
      readUntilNonControlFrame();
      if (opcode != OPCODE_CONTINUATION) {
        throw new ProtocolException("Expected continuation opcode. Got: " + toHexString(opcode));
      }
    }
  }
private void readMessage ( ) throws IOException { while ( true ) { if ( closed ) throw new IOException ( "closed" ) ; if ( frameLength > 0 ) { source . readFully ( messageFrameBuffer , frameLength ) ; if ( ! isClient ) { messageFrameBuffer . readAndWriteUnsafe ( maskCursor ) ; maskCursor . seek ( messageFrameBuffer . size ( ) - frameLength ) ; toggleMask ( maskCursor , maskKey ) ; maskCursor . close ( ) ; } } if ( isFinalFrame ) break ; readUntilNonControlFrame ( ) ; if ( opcode != OPCODE_CONTINUATION ) { throw new ProtocolException ( "Expected continuation opcode. Got: " + toHexString ( opcode ) ) ; } } }
Reads a message body into across one or more frames.
Reads a message body into across one or more frames .
// We are exhausted and have no continuations.