public static byte [ ] getBarsPostnet ( String text ) { int total = 0 ; for ( int k = text . length ( ) - 1 ; k >= 0 ; -- k ) { int n = text . charAt ( k ) - ' ' ; total += n ; } text += ( char ) ( ( ( 10 - ( total % 10 ) ) % 10 ) + ' ' ) ; byte bars [ ] = new byte [ text . length ( ) * 5 + 2 ] ; bars [ 0 ] = 1 ; bars [ bars . length - 1 ] = 1 ; for ( int k = 0 ; k < text . length ( ) ; ++ k ) { int c = text . charAt ( k ) - ' ' ; System . arraycopy ( BARS [ c ] , 0 , bars , k * 5 + 1 , 5 ) ; } return bars ; }
Creates the bars for Postnet .