Do not count last null character .
len_str -= 1 ; System . out . printf ( "Encoded String : %sNEW_LINE", String . valueOf ( encoded_String ) ) ; System . out . printf ( "Decoded_String : %sNEW_LINE", base64Decoder ( encoded_String , len_str ) ) ; } }