本文整理汇总了Java中java.io.Reader.markSupported方法的典型用法代码示例。如果您正苦于以下问题:Java Reader.markSupported方法的具体用法?Java Reader.markSupported怎么用?Java Reader.markSupported使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.Reader
的用法示例。
在下文中一共展示了Reader.markSupported方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JSONTokener
import java.io.Reader; //导入方法依赖的package包/类
/**
* Construct a JSONTokener from a Reader.
*
* @param reader A reader.
*/
public JSONTokener(Reader reader) {
this.reader = reader.markSupported()
? reader
: new BufferedReader(reader);
this.eof = false;
this.usePrevious = false;
this.previous = 0;
this.index = 0;
this.character = 1;
this.line = 1;
}
示例2: JSONTokener
import java.io.Reader; //导入方法依赖的package包/类
/**
* Construct a JSONTokener from a Reader. The caller must close the Reader.
*
* @param reader A reader.
*/
public JSONTokener(Reader reader) {
this.reader = reader.markSupported()
? reader
: new BufferedReader(reader);
this.eof = false;
this.usePrevious = false;
this.previous = 0;
this.index = 0;
this.character = 1;
this.characterPreviousLine = 0;
this.line = 1;
}
示例3: JSONTokener
import java.io.Reader; //导入方法依赖的package包/类
/**
* Construct a JSONTokener from a Reader.
*
* @param reader
* A reader.
*/
public JSONTokener(Reader reader) {
this.reader = reader.markSupported() ? reader : new BufferedReader(reader);
this.eof = false;
this.usePrevious = false;
this.previous = 0;
this.index = 0;
this.character = 1;
this.line = 1;
}
示例4: JSONTokener
import java.io.Reader; //导入方法依赖的package包/类
/**
* Construct a JSONTokener from a string.
*
* @param reader A reader.
*/
public JSONTokener(Reader reader) {
this.reader = reader.markSupported() ?
reader : new BufferedReader(reader);
this.useLastChar = false;
this.index = 0;
}
示例5: JSONTokener
import java.io.Reader; //导入方法依赖的package包/类
/**
* Construct a JSONTokener from a string.
*
* @param reader A reader.
*/
public JSONTokener(Reader reader) {
this.reader = reader.markSupported() ?
reader : new BufferedReader(reader);
this.useLastChar = false;
this.index = 0;
}
示例6: JSONTokenizer
import java.io.Reader; //导入方法依赖的package包/类
public JSONTokenizer(Reader reader) {
this.reader = reader.markSupported() ? reader : new BufferedReader(reader);
this.eof = false;
this.usePrevious = false;
this.previous = 0;
this.index = 0;
this.character = 1;
this.line = 1;
}
示例7: trailingSpace
import java.io.Reader; //导入方法依赖的package包/类
private static boolean trailingSpace(Reader in) throws IOException {
boolean trailing = false;
if (!in.markSupported()) {
// oh well
return true;
} else {
// make readAheadLimit huge -
// in practice, AVA was passed a StringReader from X500Name,
// and StringReader ignores readAheadLimit anyways
in.mark(9999);
while (true) {
int nextChar = in.read();
if (nextChar == -1) {
trailing = true;
break;
} else if (nextChar == ' ') {
continue;
} else if (nextChar == '\\') {
int followingChar = in.read();
if (followingChar != ' ') {
trailing = false;
break;
}
} else {
trailing = false;
break;
}
}
in.reset();
return trailing;
}
}
示例8: JSONTokener
import java.io.Reader; //导入方法依赖的package包/类
/**
* Construct a JSONTokener from a Reader.
*
* @param reader A reader.
*/
public JSONTokener(Reader reader) {
this.reader = reader.markSupported()
? reader
: new BufferedReader(reader);
this.eof = false;
this.usePrevious = false;
this.previous = 0;
this.index = 0;
this.character = 1;
this.line = 1;
}