static < T > int listSizeInBytes ( Buffer . Writer < T > writer , List < T > values ) { int sizeInBytes = 5 ; for ( int i = 0 , length = values . size ( ) ; i < length ; i ++ ) { sizeInBytes += writer . sizeInBytes ( values . get ( i ) ) ; } return sizeInBytes ; }
Encoding overhead is thrift type plus 32 - bit length prefix