Addendum, to what Zack said.
I think you misunderstand what window size means.
Window size is the free space in the receiver buffer, that is the amount of data that the sender can send without receiving an ACK. Usually, this space would be enough to fit several segments (maximum segment size). It says nothing about the payload size in a single segment.
Since TCP is supposed to use delayed ACKs, i.e., send ACK for every other packet, I would say that this space must be at least two segments.
example:
We need to send a file of 1380 bytes.
case 1) let's have a minimum tcp header of 20 bytes : 20 + data = 1400 -> >data = 1380 so we need two segments (20 + 1380) + (20 + 10).
so, if window size was smaller than one segment, you not only need two segments, you would need to send one segment, wait for ACK, and then send another one.
on the other hand, each path has maximum segment size (MSS). If the MSS is 1400 bytes you will need two segments, but you can send two packets one directly after another
case 2) data = 1390 < 1400 we are perfectly fine : we send one segment of size 1410.
yes, if MSS allows it you can. If not, you can still split the file between two segments, and send them one directly after another.