本文整理汇总了Java中com.sun.tools.javac.file.JavacFileManager.toArray方法的典型用法代码示例。如果您正苦于以下问题:Java JavacFileManager.toArray方法的具体用法?Java JavacFileManager.toArray怎么用?Java JavacFileManager.toArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.file.JavacFileManager
的用法示例。
在下文中一共展示了JavacFileManager.toArray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initBuf
import com.sun.tools.javac.file.JavacFileManager; //导入方法依赖的package包/类
protected char[] initBuf(JavaFileObject fileObject) throws IOException {
char[] buf;
CharSequence cs = fileObject.getCharContent(true);
if (cs instanceof CharBuffer) {
CharBuffer cb = (CharBuffer) cs;
buf = JavacFileManager.toArray(cb);
bufLen = cb.limit();
} else {
buf = cs.toString().toCharArray();
bufLen = buf.length;
}
refBuf = new SoftReference<char[]>(buf);
return buf;
}
示例2: initBuf
import com.sun.tools.javac.file.JavacFileManager; //导入方法依赖的package包/类
protected char[] initBuf(JavaFileObject fileObject) throws IOException {
char[] buf;
CharSequence cs = fileObject.getCharContent(true);
if (cs instanceof CharBuffer) {
CharBuffer cb = (CharBuffer) cs;
buf = JavacFileManager.toArray(cb);
bufLen = cb.limit();
} else {
buf = cs.toString().toCharArray();
bufLen = buf.length;
}
refBuf = new SoftReference<>(buf);
return buf;
}
示例3: Scanner
import com.sun.tools.javac.file.JavacFileManager; //导入方法依赖的package包/类
/** Create a scanner from the input buffer. buffer must implement
* array() and compact(), and remaining() must be less than limit().
*/
protected Scanner(ScannerFactory fac, CharBuffer buffer) {
this(fac, JavacFileManager.toArray(buffer), buffer.limit());
}
示例4: UnicodeReader
import com.sun.tools.javac.file.JavacFileManager; //导入方法依赖的package包/类
/**
* Create a scanner from the input array. This method might
* modify the array. To avoid copying the input array, ensure
* that {@code inputLength < input.length} or
* {@code input[input.length -1]} is a white space character.
*
* @param sf the factory which created this Scanner
* @param buffer the input, might be modified
* Must be positive and less than or equal to input.length.
*/
protected UnicodeReader(ScannerFactory sf, CharBuffer buffer) {
this(sf, JavacFileManager.toArray(buffer), buffer.limit());
}