Package java.io

Examples of java.io.PushbackReader.unread()


                                return new OrderedJSONObject(rdr, strict);
                            } else {
                                return new JSONObject(rdr,strict);
                            }
                        case '[':
                            pReader.unread(ch);
                            if (bufferIt) {
                                rdr = new BufferedReader(pReader);
                            }
                            return new JSONArray(rdr, strict);
                        case ' ':
View Full Code Here


                    // TODO what we do with commets?
                    break;
                }
                else
                {
                    reader.unread( ch );
                    processToken( reader );
                    ch = reader.read();
                }
            }
        }
View Full Code Here

                        return Types.LIST_TERMINATOR_VALUE;
                    }
                    if (secondChar == -1) {
                        throw new DataFormatException("Found header FFFF but no data");
                    }
                    reader.unread(secondChar);
                    // fall through and read as a JSON object

                case HEADER_CHAR:
                    try {
                        return JSON_MAPPER.readValue(reader, Object.class);
View Full Code Here

                retval.add(sb.toString());
                continue;
            }

            if(ch == '(') { // more attrs defined
                reader.unread(ch);
                String attrs=readUntil(reader, ')');
                sb.append(attrs);
                retval.add(sb.toString());
            }
            else {
View Full Code Here

            // line.
            for (int charIndex = 0; charIndex < readBuffer.length; charIndex++) {
                char readChar = readBuffer[charIndex];
                if (readChar == '\n') {
                    in.mark(read);
                    pushBackReader.unread(readBuffer, 0, readBuffer.length
                            - (charIndex + 1));
                    hasLineBeenRead = true;
                    break;
                } else {
                    if (readChar == delimChar && delimChar == prevChar) {
View Full Code Here

          int firstByte = reader.read();
          if (firstByte == -1) {
            ourLog.debug("No content in response, not going to read");
            reader = null;
          } else {
            reader.unread(firstByte);
          }
        } catch (IOException e) {
          ourLog.debug("No content in response, not going to read", e);
          reader = null;
        }
View Full Code Here

          int firstByte = reader.read();
          if (firstByte == -1) {
            BaseOutcomeReturningMethodBinding.ourLog.debug("No content in response, not going to read");
            reader = null;
          } else {
            reader.unread(firstByte);
          }
        } catch (IOException e) {
          BaseOutcomeReturningMethodBinding.ourLog.debug("No content in response, not going to read", e);
          reader = null;
        }
View Full Code Here

          int firstByte = reader.read();
          if (firstByte == -1) {
            ourLog.debug("No content in response, not going to read");
            reader = null;
          } else {
            reader.unread(firstByte);
          }
        } catch (IOException e) {
          ourLog.debug("No content in response, not going to read", e);
          reader = null;
        }
View Full Code Here

                        return Types.LIST_TERMINATOR_VALUE;
                    }
                    if (secondChar == -1) {
                        throw new DataFormatException("Found header FFFF but no data");
                    }
                    reader.unread(secondChar);
                    // fall through and read as a JSON object

                case HEADER_CHAR:
                    try {
                        return JSON_MAPPER.readValue(reader, Object.class);
View Full Code Here

            int firstByte = reader.read();
            if (firstByte == -1) {
              ourLog.debug("No content in response, not going to read");
              reader = null;
            } else {
              reader.unread(firstByte);
            }
          } catch (IOException e) {
            ourLog.debug("No content in response, not going to read", e);
            reader = null;
          }
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.