-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
lol Too early.
I was missing the OutputStream loading. The code excerpt below did the job:
ByteArrayOutputStream bios = new ByteArrayOutputStream();
byte[] ba1 = new byte[1024];
int baLength;
while ((baLength = is.read(ba1)) != -1) {
bios.write(ba1, 0, baLength);
}
AMedia amedia = new AMedia("myfile.pdf",
"pdf", "application/pdf", bios.toByteArray());
I hope this code can help another dudes with the same problem.
Thank you,
Gyo
2 | No.2 Revision |
lol Too early.
I was missing the OutputStream loading.
The code excerpt below did the job:trick:
ByteArrayOutputStream bios = new ByteArrayOutputStream();
byte[] ba1 = new byte[1024];
int baLength;
while ((baLength = is.read(ba1)) != -1) {
bios.write(ba1, 0, baLength);
}
AMedia amedia = new AMedia("myfile.pdf",
"pdf", "application/pdf", bios.toByteArray());
I hope this code can help another dudes with the same problem.
Thank you,
Gyo