A CharSequence provides only a single method for accessing its characters: charAt (x).
CharSequence只提供了一个方法来访问它的字符:charat (x)。
More importantly, by using the NIO package it is possible to access a file as a CharSequence.
更重要的是,通过使用NIO包,将一个文件作为CharSequence 进行访问是可能的。
To grasp how this works you first need to understand the access pattern of a Matcher to its CharSequence.
为了掌握这种方法,首先需要理解Matcher到其CharSequence的访问模式。
Therefore, since Matcher accepts CharSequence, it is possible to apply regular expressions to whole files.
因此,由于Matcher接受CharSequence,所以将正则表达式应用到全体文件是可能的。
In practice, you end up with a new class called CharBuffer, which implements CharSequence over a text file.
实际上,您最终可以使用CharBuffer这个新类,它对文本文件实现CharSequence。
In practice, you end up with a new class called CharBuffer, which implements CharSequence over a text file.
实际上,您最终可以使用CharBuffer这个新类,它对文本文件实现CharSequence。
应用推荐