本文整理匯總了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;
}