Package org.renjin.primitives.io.serialization

Examples of org.renjin.primitives.io.serialization.RDataReader


  }

  @Override
  protected SEXP doEval(Context context) {
    try {
      RDataReader reader = new RDataReader(context, resourceProvider.apply(name + ".RData"));
      return reader.readFile();
    } catch (IOException e) {
      throw new EvalException(e);
    }
  }
View Full Code Here


  }

  @Override
  protected SEXP doEval(Context context) {
    try {
      RDataReader reader = new RDataReader(context,
        new GZIPInputStream(
          new ByteArrayInputStream(bytes)));
      return reader.readFile();
    } catch (IOException e) {
      throw new EvalException(e);
    }
  }
View Full Code Here

      if(length < 0) {
        vector.add(name, new SerializedPromise(resourceProvider, name));
      } else {
        byte[] serialized = new byte[length];
        din.readFully(serialized);
        RDataReader reader = new RDataReader(context, new ByteArrayInputStream(serialized));
        vector.add(name, reader.readFile());
      }
    }
    din.close();
    return vector.build().namedValues();
  }
View Full Code Here

 
  @Test
  public void comparison() throws IOException {
   
    // output from C-R 2.12.1
    RDataReader reader = new RDataReader(topLevelContext, getClass().getResourceAsStream("expected.Rdata"));
    PairList.Node contents = (Node) reader.readFile();
    ListVector expected = contents.getElementAsSEXP(0);
   
    assertThat(expected.length(), equalTo(3));
   
    compareTree("test1.Rd", expected.get(0))
View Full Code Here

      if(!objectNames.contains(name)) {
        throw new IllegalArgumentException(name);
      }
      InputStream in = getResource("data/" + name).openStream();
      try {
        RDataReader reader = new RDataReader(in);
        return reader.readFile();
      } finally {
        Closeables.closeQuietly(in);
      }
    }
View Full Code Here

  private void processRDataFile(File dataFile) throws IOException {
    Closer closer = Closer.create();
    InputStream in = closer.register(DatasetsBuilder.decompress(dataFile));
    SEXP exp;
    try {
      RDataReader reader = new RDataReader(in);
      exp = reader.readFile();
    } catch(Throwable e) {
      throw closer.rethrow(e);
    } finally {
      in.close();
    }
View Full Code Here

TOP

Related Classes of org.renjin.primitives.io.serialization.RDataReader

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.