Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package io.dropwizard.bundles.webjars;
 
Weigh an asset according to the number of bytes it contains.
 
 class AssetWeigher implements Weigher<AssetIdAsset> {
   @Override
  public int weigh(AssetId keyAsset asset) {
    // return file size in bytes
    return (asset.bytes != null) ? asset.bytes.length : 0;
  }
New to GrepCode? Check out our FAQ X