in reply to how to read data for every 280 character ?

You are reading in chucks of 280 bytes at the time. From those chucks, you remove newlines, and then you are surprised you're left with chucks that are less than 280 characters.

If you would have a huge container of marbles, of all kinds of different colours; you then scope out 280 marbles, and from those 280, you remove all the yellow ones, will you then be surprised if you ended up with 276 marbles?

If you read in 280 bytes in a string, and you want to keep 280 bytes, don't go removing bytes from it.

  • Comment on Re: how to read data for every 280 character ?