本文整理汇总了Java中org.yaml.snakeyaml.reader.StreamReader.forward方法的典型用法代码示例。如果您正苦于以下问题:Java StreamReader.forward方法的具体用法?Java StreamReader.forward怎么用?Java StreamReader.forward使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.yaml.snakeyaml.reader.StreamReader
的用法示例。
在下文中一共展示了StreamReader.forward方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canonicalParse
import org.yaml.snakeyaml.reader.StreamReader; //导入方法依赖的package包/类
protected List<Event> canonicalParse(InputStream input2) throws IOException {
StreamReader reader = new StreamReader(new UnicodeReader(input2));
StringBuilder buffer = new StringBuilder();
while (reader.peek() != '\0') {
buffer.append(reader.peek());
reader.forward();
}
CanonicalParser parser = new CanonicalParser(buffer.toString());
List<Event> result = new ArrayList<Event>();
while (parser.peekEvent() != null) {
result.add(parser.getEvent());
}
input2.close();
return result;
}
示例2: loadAll
import org.yaml.snakeyaml.reader.StreamReader; //导入方法依赖的package包/类
@Override
public Iterable<Object> loadAll(Reader yaml) {
StreamReader reader = new StreamReader(yaml);
StringBuilder buffer = new StringBuilder();
while (reader.peek() != '\0') {
buffer.append(reader.peek());
reader.forward();
}
CanonicalParser parser = new CanonicalParser(buffer.toString());
Composer composer = new Composer(parser, resolver);
this.constructor.setComposer(composer);
Iterator<Object> result = new Iterator<Object>() {
public boolean hasNext() {
return constructor.checkData();
}
public Object next() {
return constructor.getData();
}
public void remove() {
throw new UnsupportedOperationException();
}
};
return new YamlIterable(result);
}
示例3: canonical_compose_all
import org.yaml.snakeyaml.reader.StreamReader; //导入方法依赖的package包/类
private List<Node> canonical_compose_all(InputStream file) {
StreamReader reader = new StreamReader(new UnicodeReader(file));
StringBuilder buffer = new StringBuilder();
while (reader.peek() != '\0') {
buffer.append(reader.peek());
reader.forward();
}
CanonicalParser parser = new CanonicalParser(buffer.toString());
Composer composer = new Composer(parser, new Resolver());
List<Node> documents = new ArrayList<Node>();
while (composer.checkNode()) {
documents.add(composer.getNode());
}
return documents;
}