pad10star1 returns actual length of message

Signed-off-by: Mattias Andrée <maandree@operamail.com>
improved memoery management in java version

Signed-off-by: Mattias Andrée <maandree@operamail.com>