private static FullMemcacheMessage toFullMessage ( final MemcacheMessage msg ) { if ( msg instanceof FullMemcacheMessage ) { return ( ( FullMemcacheMessage ) msg ) . retain ( ) ; } FullMemcacheMessage fullMsg ; if ( msg instanceof BinaryMemcacheRequest ) { fullMsg = toFullRequest ( ( BinaryMemcacheRequest ) msg , Unpooled . EMPTY_BUFFER ) ; } else if ( msg instanceof BinaryMemcacheResponse ) { fullMsg = toFullResponse ( ( BinaryMemcacheResponse ) msg , Unpooled . EMPTY_BUFFER ) ; } else { throw new IllegalStateException ( ) ; } return fullMsg ; }
Convert a invalid message into a full message .