From: Tobias Brunner Date: Fri, 26 Apr 2013 12:27:52 +0000 (+0200) Subject: android: Also support writing of 24-bit values X-Git-Tag: 5.1.0dr2~2^2~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75d710ec637571e2a076430173264b21d539e5cd;p=thirdparty%2Fstrongswan.git android: Also support writing of 24-bit values --- diff --git a/src/frontends/android/src/org/strongswan/android/utils/BufferedByteWriter.java b/src/frontends/android/src/org/strongswan/android/utils/BufferedByteWriter.java index 8bb9a827f6..efc7283776 100644 --- a/src/frontends/android/src/org/strongswan/android/utils/BufferedByteWriter.java +++ b/src/frontends/android/src/org/strongswan/android/utils/BufferedByteWriter.java @@ -134,6 +134,19 @@ public class BufferedByteWriter return this; } + /** + * Write 24-bit of the given value in big-endian order to the buffer + * @param value + * @return the writer + */ + public BufferedByteWriter put24(int value) + { + ensureCapacity(3); + mWriter.put((byte)(value >> 16)); + mWriter.putShort((short)value); + return this; + } + /** * Write the given int value (32-bit) in big-endian order to the buffer * @param value