protected boolean isValidString ( CobolContext cobolContext , byte [ ] hostData , int start ) { int length = start + getBytesLen ( ) ; for ( int i = start ; i < length ; i ++ ) { int code = hostData [ i ] & 0xFF ; if ( code != 0 && code < cobolContext . getHostSpaceCharCode ( ) ) { return false ; } } return true ; }
Relatively naive implementation that assumes content is either low - value or a code point greater or equal to the space character .