Don Newton | 379ae25 | 2019-04-01 12:17:06 -0400 | [diff] [blame^] | 1 | // Copyright (C) MongoDB, Inc. 2017-present. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | // not use this file except in compliance with the License. You may obtain |
| 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | |
| 7 | package wiremessage |
| 8 | |
| 9 | func appendInt32(b []byte, i int32) []byte { |
| 10 | return append(b, byte(i), byte(i>>8), byte(i>>16), byte(i>>24)) |
| 11 | } |
| 12 | |
| 13 | func appendCString(b []byte, str string) []byte { |
| 14 | b = append(b, str...) |
| 15 | return append(b, 0x00) |
| 16 | } |
| 17 | |
| 18 | func appendInt64(b []byte, i int64) []byte { |
| 19 | return append(b, byte(i), byte(i>>8), byte(i>>16), byte(i>>24), byte(i>>32), byte(i>>40), byte(i>>48), byte(i>>56)) |
| 20 | } |