Package java.io

Examples of java.io.PushbackReader.unread()


            if (ch == -1)
                return headerOnly(writer.toString());

            // if not XML, finish
            if (ch != '<') {
                xml.unread(ch);
                _header = writer.toString().toCharArray();
                return xml;
            }

            // if the root element, finish
View Full Code Here


            }

            // if the root element, finish
            ch = xml.read();
            if (ch != '?' && ch != '!') {
                xml.unread(ch);
                xml.unread('<');
                _header = writer.toString().toCharArray();
                return xml;
            }
View Full Code Here

            // if the root element, finish
            ch = xml.read();
            if (ch != '?' && ch != '!') {
                xml.unread(ch);
                xml.unread('<');
                _header = writer.toString().toCharArray();
                return xml;
            }

            // if a doc type element, finish
View Full Code Here

            }

            // if a doc type element, finish
            ch2 = xml.read();
            if (ch == '!' && ch2 == 'D') {
                xml.unread(ch2);
                xml.unread(ch);
                xml.unread('<');
                _header = writer.toString().toCharArray();
                _docType = null; // make sure doc type not included
                return xml;
View Full Code Here

            // if a doc type element, finish
            ch2 = xml.read();
            if (ch == '!' && ch2 == 'D') {
                xml.unread(ch2);
                xml.unread(ch);
                xml.unread('<');
                _header = writer.toString().toCharArray();
                _docType = null; // make sure doc type not included
                return xml;
            }
View Full Code Here

            // if a doc type element, finish
            ch2 = xml.read();
            if (ch == '!' && ch2 == 'D') {
                xml.unread(ch2);
                xml.unread(ch);
                xml.unread('<');
                _header = writer.toString().toCharArray();
                _docType = null; // make sure doc type not included
                return xml;
            }
View Full Code Here

            for (ch = xml.read(); ch != -1
                && Character.isWhitespace((char) ch); ch = xml.read())
                writer.write(ch);
            if (ch == -1)
                return headerOnly(writer.toString());
            xml.unread(ch);
        }
    }

    /**
     * If the stream contained only space, think of it as pure XML with no
View Full Code Here

      PushbackReader pReader2 = new PushbackReader(reader2, 2);
      boolean skipped = false;
      long numSkipped = 0;
      try {
        numSkipped = pReader2.skip(3);
        pReader2.unread('a');
        pReader2.unread('b');
        numSkipped += pReader2.skip(10);
        numSkipped += pReader2.skip(10);
        numSkipped += pReader2.skip(10);
        numSkipped += pReader2.skip(10);
View Full Code Here

      boolean skipped = false;
      long numSkipped = 0;
      try {
        numSkipped = pReader2.skip(3);
        pReader2.unread('a');
        pReader2.unread('b');
        numSkipped += pReader2.skip(10);
        numSkipped += pReader2.skip(10);
        numSkipped += pReader2.skip(10);
        numSkipped += pReader2.skip(10);
        numSkipped += pReader2.skip(10);
View Full Code Here

                Reader rdr = pReader;
                int ch = pReader.read();
                while (ch != -1) {
                    switch (ch) {
                        case '{':
                            pReader.unread(ch);
                            if (bufferIt) {
                                rdr = new BufferedReader(pReader);
                            }
                            if (order) {
                                return new OrderedJSONObject(rdr, strict);
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.