Package com.caucho.vfs

Examples of com.caucho.vfs.ReadStream


    char []buf = new char[256];
    int len;

    Object obj = call.getArgObject(0, length);
    if (obj instanceof ReadStream) {
      ReadStream is = (ReadStream) obj;
      os.writeStream(is);
    }
    else if (obj instanceof ReadWritePair) {
      os.writeStream(((ReadWritePair) obj).getReadStream());
    }
View Full Code Here


          loader = _systemClassLoader;

        is = loader.getResourceAsStream(pkg.replace('.', '/') + "/namespace");

        if (is != null) {
          ReadStream in = Vfs.openRead(is);
          String line;
          while ((line = in.readLine()) != null) {
            for (String name : line.split("[ \t\r\n]+")) {
              if (! "".equals(name)) {
                if (! pkgList.contains(name))
                  pkgList.add(name);
              }
View Full Code Here

public class PathEcmaWrap {
  public static ReadStream openRead(Path p)
    throws IOException
  {
    ReadStream s = p.openRead();
    Exit.addExit(exitInputStream, s);
    return s;
  }
View Full Code Here

  }

  public static int readByte(ReadWritePair s)
  throws IOException
  {
    ReadStream is = s.getReadStream();
    return is.read();
  }
View Full Code Here

  }

  public static String read(ReadWritePair s)
  throws IOException
  {
    ReadStream is = s.getReadStream();
    int ch = is.readChar();

    if (ch < 0)
      return null;

    return String.valueOf((char) ch);
View Full Code Here

  }

  public static String read(ReadWritePair s, int length)
  throws IOException
  {
    ReadStream is = s.getReadStream();
    CharBuffer cb = new CharBuffer();

    for (; length > 0; length--) {
      int ch = is.readChar();

      if (ch < 0)
        break;

      cb.append((char) ch);
View Full Code Here

  }

  public static String readAvailable(ReadWritePair s, int length)
    throws IOException
  {
    ReadStream is = s.getReadStream();
    CharBuffer cb = new CharBuffer();

    while (is.getAvailable() > 0) {
      int ch = is.readChar();

      if (ch < 0)
        break;

      cb.append((char) ch);
View Full Code Here

  }

  public static String readln(ReadWritePair s)
  throws IOException
  {
    ReadStream is = s.getReadStream();
    CharBuffer cb = new CharBuffer();

    if (! is.readln(cb))
      return null;

    return cb.toString();
  }
View Full Code Here

    } catch (Throwable e) {
    }
 
    path = getScriptPath().lookup(name);

    ReadStream is = path.openRead();
    try {
      return parse(is, name, 1);
    } finally {
      is.close();
    }
  }
View Full Code Here

        serviceSet.add(url);

        InputStream is = null;
        try {
          is = url.openStream();
          ReadStream in = Vfs.openRead(is);

          String line;

          while ((line = in.readLine()) != null) {
            int p = line.indexOf('#');
            if (p >= 0)
              line = line.substring(0, p);
            line = line.trim();

            if (line.length() > 0) {
              Class<T> cl = loadServiceClass(serviceApiClass, line);

              if (cl != null)
                services.add(createTransientObject(cl));
            }
          }

          in.close();
        } catch (IOException e1) {
          log.log(Level.WARNING, e1.toString(), e1);
        } finally {
          IoUtil.close(is);
        }
View Full Code Here

TOP

Related Classes of com.caucho.vfs.ReadStream

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.