Public Sub SendPhoto(Data() As Byte)
Dim bc as ByteConverter 'if not already done elsewhere
Dim ChunkSize As Int = 30 'or whatever, eg 20 for Bluetooth Low Energy
Dim SendBuffer(ChunkSize) As Byte
Dim BytesToSend As Int
For ChunkStart = 0 to Data.Length - 1 Step ChunkSize
BytesToSend = Data.Length - ChunkStart
If BytesToSend > ChunkSize Then
BytesToSend = ChunkSize
End If
bc.ArrayCopy(Data, ChunkStart, SendBuffer, 0, BytesToSend)
ptChannel.SendPublicCustomMessage(SendBuffer, BytesToSend) 'trust that this sends only the specified number of bytes
Next
)