Package com.caucho.quercus.lib

Examples of com.caucho.quercus.lib.UnserializeReader


  public boolean decode(Env env, StringValue encoded)
  {
    ArrayValue array = getArray();

    try {
      UnserializeReader is = new UnserializeReader(encoded);

      synchronized (array) {
        while (true) {
          int ch;

          StringValue sb = env.createUnicodeBuilder();

          while ((ch = is.read()) > 0 && ch != '|') {
            sb.append((char) ch);
          }

          if (sb.length() == 0)
            return true;

          array.put(sb, is.unserialize(env));
        }
      }
    } catch (IOException e) {
      throw new QuercusModuleException(e);
    }
View Full Code Here


  public boolean decode(Env env, String encoded)
  {
    ArrayValue array = getArray();

    try {
      UnserializeReader is = new UnserializeReader(encoded);

      StringBuilder sb = new StringBuilder();

      synchronized (array) {
        while (true) {
          int ch;

          sb.setLength(0);

          while ((ch = is.read()) > 0 && ch != '|') {
            sb.append((char) ch);
          }

          if (sb.length() == 0)
            return true;

          String key = sb.toString();

          array.put(env.createStringOld(key), is.unserialize(env));
        }
      }
    } catch (IOException e) {
      throw new QuercusModuleException(e);
    }
View Full Code Here

  public boolean decode(Env env, StringValue encoded)
  {
    ArrayValue array = getArray();

    try {
      UnserializeReader is = new UnserializeReader(encoded);

      synchronized (array) {
        while (true) {
          int ch;

          StringValue sb = env.createUnicodeBuilder();

          while ((ch = is.read()) > 0 && ch != '|') {
            sb.append((char) ch);
          }

          if (sb.length() == 0)
            return true;

          array.put(sb, is.unserialize(env));
        }
      }
    } catch (IOException e) {
      throw new QuercusModuleException(e);
    }
View Full Code Here

TOP

Related Classes of com.caucho.quercus.lib.UnserializeReader

Copyright © 2018 www.massapicom. 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.