Skip to content
Back to formatted view

Raw Message

Message-ID: <76189e25050815203379654093@mail.gmail.com>
Date: 2005-08-16T03:33:12Z
From: Márcio de Medeiros Ribeiro
Subject: Image from bytes streams

Hello!

I'm trying to get an array of bytes from graphic images generated by
R. Here, you can see my Java code:

--------------------------------------------------------------------------------------------------------------------------
Process p = Runtime.getRuntime().exec("C:/Arquivos de
programas/R/rw1090/bin/Rterm.exe --no-save");

DataOutputStream output = new DataOutputStream(new
BufferedOutputStream(p.getOutputStream()));

DataInputStream input = new DataInputStream(new
BufferedInputStream(p.getInputStream()));

// output.writeBytes("pie(c(50,30,20))"); //Pie graphic
output.writeBytes("plot(1,1)"); // Plot graphic
output.flush();

input.readFully(new byte[200]); // Here I read the "image" bytes.
--------------------------------------------------------------------------------------------------------------------------

That's the problem: when I use Pie graphic, I got some bytes. However,
when I use the Plot graphic, I got the same bytes! So, I suppose that
my program does not read the bytes from the generated graphic from R.

Is it possible to get the bytes from the generated graphic? How can I
get these bytes?

Sorry about my english. I'm brazilian! :)
-- 
M??rcio de Medeiros Ribeiro
Graduando em Ci??ncia da Computa????o
Departamento de Tecnologia da Informa????o - TCI
Universidade Federal de Alagoas - UFAL
Macei?? - Alagoas - Brasil
Projeto ArCo - Arcabou??o de Comunidades
Contato: +55 82 354-3358/9997-6794