Hi,
It is not neccessary use POI to get content of Excel file.
you can use such chunk of code:
InputStream is = ...
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int nRead;
byte[] data = new byte[16384];
while ((nRead = is.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, nRead);
}
buffer.flush();
return buffer.toByteArray();
Regrads, Evgeniy Berlog
On Fri, Jul 27, 2012 at 10:52 AM, elmodai <[email protected]> wrote:
> Hi,
>
> I'd like to:
>
> 1. Read a file excel file from filesystem (disk) and store the data in
> memory using byte array.
> 2. then, write that content to another excel file that must be commited on
> a
> SVN.
>
> I have tried it using pure Java, without libraries like POI. But I couldn't
> do it.
> I have sucess doing it only with PDF and TXT files, because when I try with
> excel file, that fle was created damaged.
>
> Somebody can help me? I only need the explanation to extract the the
> content
> of excel files to byte array.
>
> thank you!
>
>
>
> --
> View this message in context:
> http://apache-poi.1045710.n5.nabble.com/Trying-to-read-extract-content-from-xlsx-xls-file-and-store-it-on-byte-array-tp5710544.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>