wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes Merging byte arrays using SequenceInputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Merging byte arrays using SequenceInputStream" Watch "Merging byte arrays using SequenceInputStream" New topic
Author

Merging byte arrays using SequenceInputStream

avani vakharwala
Greenhorn

Joined: Jan 24, 2008
Posts: 6

Problem :
Retrieving byte array from database
Storing each byte array in file
and Merging all those files in single file.

However ,I don't want to store file on disk.
Each byte array which i am retrieving from database should be merge together on fly as single large byte array.

I have tried using Byte Array (java.nio) but it is not giving me desired output.

Following is the code snippet
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

Why don't you write to the single file while you loop over the ResultSet, effectively getting rid of all the temporary files?

In pseudo code:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Merging byte arrays using SequenceInputStream
 
Similar Threads
send files over the socket
How to Change the File Name for Each Uploaded Files to the Socket Server?
SequenceInputStream performance
Problem in merging PPT files using java
Problem in setBinaryStream when using SequenceInputStream