Examples of StreamReader


Examples of org.yaml.snakeyaml.reader.StreamReader

public class ParserImplTest extends TestCase {

    public void testGetEvent() {
        String data = "string: abcd";
        StreamReader reader = new StreamReader(data);
        Parser parser = new ParserImpl(reader);
        Mark dummyMark = new Mark("dummy", 0, 0, 0, "", 0);
        LinkedList<Event> etalonEvents = new LinkedList<Event>();
        etalonEvents.add(new StreamStartEvent(dummyMark, dummyMark));
        etalonEvents.add(new DocumentStartEvent(dummyMark, dummyMark, false, null, null));
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

        assertFalse("Must contain no more events: " + parser.getEvent(), parser.checkEvent(null));
    }

    public void testGetEvent2() {
        String data = "american:\n  - Boston Red Sox";
        StreamReader reader = new StreamReader(data);
        Parser parser = new ParserImpl(reader);
        Mark dummyMark = new Mark("dummy", 0, 0, 0, "", 0);
        LinkedList<Event> etalonEvents = new LinkedList<Event>();
        etalonEvents.add(new StreamStartEvent(dummyMark, dummyMark));
        etalonEvents.add(new DocumentStartEvent(dummyMark, dummyMark, false, null, null));
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

        assertTrue(file.isFile());
        return file;
    }

    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());
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

        input2.close();
        return result;
    }

    protected List<Event> parse(InputStream input) throws IOException {
        StreamReader reader = new StreamReader(new UnicodeReader(input));
        Parser parser = new ParserImpl(reader);
        List<Event> result = new ArrayList<Event>();
        while (parser.peekEvent() != null) {
            result.add(parser.getEvent());
        }
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

            Charset charset = byteList.getEncoding().getCharset();
            if (charset == null) charset = Charset.defaultCharset();

            InputStreamReader isr = new InputStreamReader(bais, charset);

            return new StreamReader(isr);
        }

        // fall back on IOInputStream, using default charset
        if (yaml.respondsTo("read")) {
            Charset charset = (yaml instanceof RubyIO)
                ? ((RubyIO)yaml).getReadEncoding().getCharset()
                : Charset.defaultCharset();
            return new StreamReader(new InputStreamReader(new IOInputStream(yaml), charset));
        } else {
            throw runtime.newTypeError(yaml, runtime.getIO());
        }
    }
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

    {
        super(ctxt, parserFeatures);   
        _objectCodec = codec;
        _yamlFeatures = csvFeatures;
        _reader = reader;
        _yamlParser = new ParserImpl(new StreamReader(reader));
    }
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

    {
        super(ctxt, parserFeatures);   
        _objectCodec = codec;
        _yamlFeatures = csvFeatures;
        _reader = reader;
        _yamlParser = new ParserImpl(new StreamReader(reader));
    }
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

     * @param yaml
     *            YAML data to load from (BOM must not be present)
     * @return parsed object
     */
    public Object load(String yaml) {
        return loadFromReader(new StreamReader(yaml), Object.class);
    }
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

     * @param io
     *            data to load from (BOM is respected and removed)
     * @return parsed object
     */
    public Object load(InputStream io) {
        return loadFromReader(new StreamReader(new UnicodeReader(io)), Object.class);
    }
View Full Code Here

Examples of util.StreamReader

  public synchronized void acceptSocket(Socket socket) throws IOException, InterruptedException {
    checkForPulse();
    fitSocket = socket;
    fitInput = fitSocket.getOutputStream();
    FitProtocol.writeData("", fitInput);
    fitOutput = new StreamReader(fitSocket.getInputStream());

    fitListeningThread = new Thread(new FitListeningRunnable(), "FitClient fitOutput");
    fitListeningThread.start();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.