i have a larget text file of 1mb how do i break


I have a larget text file of 1MB, how do i break down into chunks of packets to send over UDP?

byte b[]=new byte[1024];
FileInputStream f=new FileInputStream("input.txt");
DatagramSocket dsoc=new DatagramSocket(2000);
int i=0;
while(f.available()!=0)
{
b[i]=(byte)f.read();
i++;
}
f.close();
dsoc.send(new DatagramPacket(b,i,InetAddress.getLocalHost(),1000));

this doesnt seems to work

Request for Solution File

Ask an Expert for Answer!!
Computer Networking: i have a larget text file of 1mb how do i break
Reference No:- TGS0177479

Expected delivery within 24 Hours