This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Android and the fly likes Fast way to write and read buffered data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Mobile » Android
Bookmark "Fast way to write and read buffered data" Watch "Fast way to write and read buffered data" New topic

Fast way to write and read buffered data

Adam Kronicki
Ranch Hand

Joined: Sep 01, 2009
Posts: 68
I have a working implementation of the AudioRecrod class. I however I
need the samples only in a buffered form so I don't want to save them
on the phone hard memory, but keep them in a buffered way. Write now I
am saving the files using an ArrayList of type <Short> like that:

for (int idxBuffer = 0; idxBuffer < bufferRead; ++idxBuffer) {


However you can tell that ArrayList is not an effective way to do
this, and also the values are saved as Short not short. I was thinking
about using some of the stream buffers but they mostly only work with
byte[] arrays not short[]. yes I can convert the short to byte but
that again takes some more time...

What would be the fastest way to do it? Every source I googled seems
to be using the 'save to file' approach which definitely can't be the
fastest way. What would you suggest?
Have you checked out Aspose?
subject: Fast way to write and read buffered data
It's not a secret anymore!