]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Also support writing of 24-bit values
authorTobias Brunner <tobias@strongswan.org>
Fri, 26 Apr 2013 12:27:52 +0000 (14:27 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 8 Jul 2013 16:49:27 +0000 (18:49 +0200)
src/frontends/android/src/org/strongswan/android/utils/BufferedByteWriter.java

index 8bb9a827f6a65158b236940ff7d21e5acd46f713..efc7283776e9224fe33055411fc04320b1607647 100644 (file)
@@ -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