while creating a contract between server and client apps should we use bits to represent bool values to optimise payload.
So far I have always come across bools in APIs. why dont we use bit
to represent this info.
while creating a contract between server and client apps should we use bits to represent bool values to optimise payload.
So far I have always come across bools in APIs. why dont we use bit
to represent this info.
Because Byte
is the smallest addressable unit of memory in many computer architectures. You cann't address a single bit
. There are also no such data type in java.
Frome wikipedia:
Historically, the byte was the number of bits used to encode a single character of text in a computer[1][2] and for this reason it is the smallest addressable unit of memory in many computer architectures.