Do you know how to read and write files? If not, the Java Tutorial IO chapter is a good place to start. I'm curious, why are you splitting the file? There's no arbitrary limit to the length of a stream. Do you have a receiving process that will reassemble the file?
i need to split file because , iwant to send these files over queue. but my queue limit is 4MB, so i cant send file of size more than 4mb to a queue. if my file size is more than 4mb , i need to split it and send over queue