private static int contentLength ( Object msg ) { if ( msg instanceof MemcacheContent ) { return ( ( MemcacheContent ) msg ) . content ( ) . readableBytes ( ) ; } if ( msg instanceof ByteBuf ) { return ( ( ByteBuf ) msg ) . readableBytes ( ) ; } if ( msg instanceof FileRegion ) { return ( int ) ( ( FileRegion ) msg ) . count ( ) ; } throw new IllegalStateException ( "unexpected message type: " + StringUtil . simpleClassName ( msg ) ) ; }
Determine the content length of the given object .