From d4dbf85d9536bfec85252a58fc552e2bad42ff17 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 4 Oct 2015 13:20:46 +1300 Subject: Remove trailing whitespaces from code --- src/org/traccar/helper/ChannelBufferTools.java | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/org/traccar/helper/ChannelBufferTools.java') diff --git a/src/org/traccar/helper/ChannelBufferTools.java b/src/org/traccar/helper/ChannelBufferTools.java index 12e8fc93d..75c16ae50 100644 --- a/src/org/traccar/helper/ChannelBufferTools.java +++ b/src/org/traccar/helper/ChannelBufferTools.java @@ -55,14 +55,14 @@ public class ChannelBufferTools { return null; } - + /** * Convert hex to integer (length in hex digits) */ public static int readHexInteger(ChannelBuffer buf, int length) { - + int result = 0; - + for (int i = 0; i < length / 2; i++) { int b = buf.readUnsignedByte(); result *= 10; @@ -70,13 +70,13 @@ public class ChannelBufferTools { result *= 10; result += b & 0x0f; } - + if (length % 2 == 1) { int b = buf.getUnsignedByte(buf.readerIndex()); result *= 10; result += b >>> 4; } - + return result; } @@ -84,22 +84,22 @@ public class ChannelBufferTools { * Return hex string */ public static String readHexString(ChannelBuffer buf, int length) { - + StringBuilder result = new StringBuilder(); Formatter formatter = new Formatter(result); - + for (int i = 0; i < length / 2; i++) { formatter.format("%02x", buf.readByte()); } - + if (length % 2 == 1) { int b = buf.getUnsignedByte(buf.readerIndex()); formatter.format("%01x", b >>> 4); } - + return result.toString(); } - + /** * Read BCD coded coordinate (first byte has sign bit) */ @@ -108,16 +108,16 @@ public class ChannelBufferTools { int b2 = buf.readUnsignedByte(); int b3 = buf.readUnsignedByte(); int b4 = buf.readUnsignedByte(); - + double value = (b2 & 0xf) * 10 + (b3 >> 4); value += (((b3 & 0xf) * 10 + (b4 >> 4)) * 10 + (b4 & 0xf)) / 1000.0; value /= 60; value += ((b1 >> 4 & 0x7) * 10 + (b1 & 0xf)) * 10 + (b2 >> 4); - + if ((b1 & 0x80) != 0) { value = -value; } - + return value; } -- cgit v1.2.3