commit | 9e946576e38aeae37627032c3cd71ba3cea49e4c | [log] [tgz] |
---|---|---|
author | Adam Vartanian <flooey@google.com> | Tue Mar 12 10:47:20 2019 +0000 |
committer | Adam Vartanian <flooey@google.com> | Tue Mar 12 10:47:20 2019 +0000 |
tree | 8f3179eca808831eeb231e1c6779b51002e2536d | |
parent | ba9f6875c17afdbc6c33c886e8877c5ee47377f5 [diff] |
Fix MulticastSocket example code The example code works for all-ASCII strings, but DatagramPacket's length argument takes the byte length and String.length() returns the number of UTF-16 characters, so if a string has any non-ASCII characters s.length() != s.getBytes().length. Bug: 127912421 Test: make docs Change-Id: I3e16780edf030807f9158ec76760262a0460b84c