public static int calculateItemSizeInBytes(Map<String,AttributeValue> item){
  int size=0;
  if (item == null) {
    return size;
  }
  for (  Map.Entry<String,AttributeValue> entry : item.entrySet()) {
    String name=entry.getKey();
    AttributeValue value=entry.getValue();
    size+=name.getBytes(BootstrapConstants.UTF8).length;
    size+=calculateAttributeSizeInBytes(value);
  }
  return size;
}

public static int calculateItemSizeInBytes ( Map < String , AttributeValue > item ) { int size = 0 ; if ( item == null ) { return size ; } for ( Map . Entry < String , AttributeValue > entry : item . entrySet ( ) ) { String name = entry . getKey ( ) ; AttributeValue value = entry . getValue ( ) ; size += name . getBytes ( BootstrapConstants . UTF8 ) . length ; size += calculateAttributeSizeInBytes ( value ) ; } return size ; }
calculate dynamodb item size .
