Post

Replies

Boosts

Views

Activity

Can NSInputStream.read(_:maxLength:) read less than maxLength even if more is available?
Can NSInputStream.read(_:maxLength:) return less bytes read even when more data available? I haven't found it in the docs Use-case: we pass maxLength = 512, but actual reading of 512 bytes will do in 2 rounds: 256 in first round + 256 in second. It's important for my use-case (encryption/decryption) not to have intermediate partial readings unless it's last "tail" part. Otherwise I might end-up encrypting different-length blocks & decryption will fail assuming different buffer length.
2
0
706
Jan ’22
Can NSInputStream.read(_:maxLength:) read less than maxLength even if more is available?
Can NSInputStream.read(_:maxLength:) return less bytes read even when more data available? I haven't found it in the docs Use-case: we pass maxLength = 512, but actual reading of 512 bytes will do in 2 rounds: 256 in first round + 256 in second. It's important for my use-case (encryption/decryption) not to have intermediate partial readings unless it's last "tail" part. Otherwise I might end-up encrypting different-length blocks & decryption will fail assuming different buffer length.
Replies
2
Boosts
0
Views
706
Activity
Jan ’22