From 77492816e25ccb57c15c7f1ce66abf6b3913df3a Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 9 Mar 2016 01:22:54 +0100 Subject: [PATCH] Better javadocs --- .../dorkbox/util/bytes/OptimizeUtilsByteArray.java | 13 +++++++------ .../dorkbox/util/bytes/OptimizeUtilsByteBuf.java | 10 ++++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Dorkbox-Util/src/dorkbox/util/bytes/OptimizeUtilsByteArray.java b/Dorkbox-Util/src/dorkbox/util/bytes/OptimizeUtilsByteArray.java index b5fe2a7..7819d6e 100644 --- a/Dorkbox-Util/src/dorkbox/util/bytes/OptimizeUtilsByteArray.java +++ b/Dorkbox-Util/src/dorkbox/util/bytes/OptimizeUtilsByteArray.java @@ -212,10 +212,11 @@ class OptimizeUtilsByteArray { } /** - * Returns the number of bytes that would be written with {@link #writeLong(byte[], long, boolean)}. + * Returns 1-9 bytes that would be written with {@link #writeLong(byte[], long, boolean)}. * * @param optimizePositive - * true if you want to optimize the number of bytes needed to write the length value + * If true, small positive numbers will be more efficient (1 byte) and small negative numbers will be inefficient (9 + * bytes). This ultimately means that it will use fewer bytes for positive numbers. */ public static int longLength(long value, boolean optimizePositive) { @@ -229,7 +230,8 @@ class OptimizeUtilsByteArray { * Reads a 1-9 byte long. * * @param optimizePositive - * true if you want to optimize the number of bytes needed to write the length value + * If true, small positive numbers will be more efficient (1 byte) and small negative numbers will be inefficient (9 + * bytes). This ultimately means that it will use fewer bytes for positive numbers. */ public static long readLong(byte[] buffer, boolean optimizePositive) { @@ -244,7 +246,8 @@ class OptimizeUtilsByteArray { * * @param position where in the buffer to start reading * @param optimizePositive - * true if you want to optimize the number of bytes needed to write the length value + * If true, small positive numbers will be more efficient (1 byte) and small negative numbers will be inefficient (9 + * bytes). This ultimately means that it will use fewer bytes for positive numbers. */ public static long readLong(final byte[] buffer, final boolean optimizePositive, int position) { @@ -468,8 +471,6 @@ class OptimizeUtilsByteArray { return position != limit; } - - private OptimizeUtilsByteArray() { } diff --git a/Dorkbox-Util/src/dorkbox/util/bytes/OptimizeUtilsByteBuf.java b/Dorkbox-Util/src/dorkbox/util/bytes/OptimizeUtilsByteBuf.java index 4d7a248..32ca31e 100644 --- a/Dorkbox-Util/src/dorkbox/util/bytes/OptimizeUtilsByteBuf.java +++ b/Dorkbox-Util/src/dorkbox/util/bytes/OptimizeUtilsByteBuf.java @@ -178,10 +178,11 @@ class OptimizeUtilsByteBuf { // long /** - * Returns the number of bytes that would be written with {@link #writeLong(ByteBuf, long, boolean)}. + * Returns the 1-9 bytes that would be written with {@link #writeLong(ByteBuf, long, boolean)}. * * @param optimizePositive - * true if you want to optimize the number of bytes needed to write the length value + * If true, small positive numbers will be more efficient (1 byte) and small negative numbers will be inefficient (9 + * bytes). This ultimately means that it will use fewer bytes for positive numbers. */ public static int longLength(long value, boolean optimizePositive) { @@ -221,7 +222,8 @@ class OptimizeUtilsByteBuf { * Reads a 1-9 byte long. * * @param optimizePositive - * true if you want to optimize the number of bytes needed to write the length value + * If true, small positive numbers will be more efficient (1 byte) and small negative numbers will be inefficient (9 + * bytes). This ultimately means that it will use fewer bytes for positive numbers. */ public static long readLong(ByteBuf buffer, boolean optimizePositive) { @@ -272,7 +274,7 @@ class OptimizeUtilsByteBuf { * * @param optimizePositive * If true, small positive numbers will be more efficient (1 byte) and small negative numbers will be inefficient (9 - * bytes). + * bytes). This ultimately means that it will use fewer bytes for positive numbers. * * @return the number of bytes written. */