Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Regular Contributor
Posts: 59
Registered: ‎03-01-2011
My Device: Not Specified

Re: size limit of byte[] array

i am using this code to read data in chunks ns saving but its not downloading & saving to full size. Just few kbs

DataBuffer db =

newDataBuffer();

data =

newbyte[8192];

 

intchunk = 0;

 

if(!fc.exists()) {

fc.create();

}

OutputStream outStream = fc.openOutputStream();

while ( -1 != (chunk = dis.read(data)) )

{

db.write(data, 0, chunk);

// create the file if it doesn't exist

outStream.write(data);

 

 

}

outStream.flush();

outStream.close();

fc.close();

pls help where doing mistake

Regular Contributor
Posts: 59
Registered: ‎03-01-2011
My Device: Not Specified

Re: size limit of byte[] array

yes its working fine now