I know it could seem a trivial question, nevertheless in my opinion it doesn't.
My problem is to check fileName lenght (before the file it is created) and throw an exception when the lenght is greater than the maximum lenght allowed for the current file system .
For example, in Linux (file system ext3)
the maximum filename size is 255 bytes.
The lenght() method of String class returns the number of 16-bit unicode characters in the string.
In your opinion my check should be:
if (fileName.lenght() > 255 ....
or
if (fileName.lenght() > 255/2 ....
Thanks in advance, best regards.
Raffaele