public int getCloseCode ( ) { if ( mPayload == null || mPayload . length < 2 ) { return WebSocketCloseCode . NONE ; } // A close code is encoded in network byte order. int closeCode = ( ( ( mPayload [ 0 ] & 0xFF ) << 8 ) | ( mPayload [ 1 ] & 0xFF ) ) ; return closeCode ; }
Parse the first two bytes of the payload as a close code .