nl_tokens: / * ( non - Javadoc )
pl_tokens: public synchronized Charset detectCodepage ( InputStream in , int length ) throws IOException { this . Reset ( ) ; int len ; int read = 0 ; boolean done = false ; boolean isAscii = true ; Charset ret = null ; do { len = in . read ( buf , 0 , Math . <mask> ( buf . length , length - read ) ) ; if ( len > 0 ) { read += len ; } if ( ! done ) done = det . DoIt ( buf , len , false ) ; } while ( len > 0 && ! done ) ; det . DataEnd ( ) ; if ( this . codpage == null ) { if ( this . m_guessing ) { ret = guess ( ) ; } else { ret = UnknownCharset . getInstance ( ) ; } } else { ret = this . codpage ; } return ret ; }