@Test public void getSignedMedium() { assertEquals( 0, AkServerUtil.getMediumInt(byteArray(0x00, 0x00, 0x00), 0)); assertEquals( 1, AkServerUtil.getMediumInt(byteArray(0x01, 0x00, 0x00), 0)); assertEquals( 8388607, AkServerUtil.getMediumInt(byteArray(0xFF, 0xFF, 0x7F), 0)); assertEquals(-8388608, AkServerUtil.getMediumInt(byteArray(0x00, 0x00, 0x80), 0)); assertEquals( -2, AkServerUtil.getMediumInt(byteArray(0xFE, 0xFF, 0xFF), 0)); assertEquals( -1, AkServerUtil.getMediumInt(byteArray(0xFF, 0xFF, 0xFF), 0)); }
public static int getMediumInt(byte[] bytes, int index) { final int value = getUMediumInt(bytes, index); return (value << 8) >> 8; }
AkServerUtil { public static int getMediumInt(byte[] bytes, int index) { final int value = getUMediumInt(bytes, index); return (value << 8) >> 8; } }
AkServerUtil { public static int getMediumInt(byte[] bytes, int index) { final int value = getUMediumInt(bytes, index); return (value << 8) >> 8; }  }
AkServerUtil { public static int getMediumInt(byte[] bytes, int index) { final int value = getUMediumInt(bytes, index); return (value << 8) >> 8; }  static long getSignedIntegerByWidth(final byte[] bytes, final int index, final int width); static long getUnsignedIntegerByWidth(final byte[] bytes, final int index, final int width); static int putIntegerByWidth(byte[] destination, int destinationIndex, int width, long value); static byte getByte(byte[] bytes, int index); static short getUByte(byte[] bytes, int index); static short getShort(byte[] bytes, int index); static int getUShort(byte[] bytes, int index); static int getMediumInt(byte[] bytes, int index); static int getUMediumInt(byte[] bytes, int index); static int getInt(byte[] bytes, int index); static long getUInt(byte[] bytes, int index); static long getLong(byte[] bytes, int index); static BigInteger getULong(byte[] bytes, int index); static void putByte(byte[] bytes, int index, int value); static void putShort(byte[] bytes, int index, int value); static void putMediumInt(byte[] bytes, int index, int value); static void putInt(byte[] bytes, int index, int value); static void putLong(byte[] bytes, int index, long value); static String dump(byte[] b, int offset, int size); static String hex(byte[] bytes, int start, int length); static StringBuilder hex(StringBuilder sb, long value, int length); static void hex(AkibanAppender sb, byte[] bytes, int start,
            int length); static void printRuntimeInfo(); final static boolean cleanUpDirectory(final File file); final static boolean cleanUpFiles(final File[] files); static String decodeMySQLString(byte[] bytes, final int offset,
            final int width, final FieldDef fieldDef); static ByteSource byteSourceForMySQLString(byte[] bytes, final int offset,
                                                      final int width, final FieldDef fieldDef); static ByteBuffer byteBufferForMySQLString(byte[] bytes, final int offset,
                                           final int width, final FieldDef fieldDef); static int varWidth(final int length); static boolean equals(final Object a, final Object b); static int hashCode(final Object o); }
AkServerUtil { public static int getMediumInt(byte[] bytes, int index) { final int value = getUMediumInt(bytes, index); return (value << 8) >> 8; }  static long getSignedIntegerByWidth(final byte[] bytes, final int index, final int width); static long getUnsignedIntegerByWidth(final byte[] bytes, final int index, final int width); static int putIntegerByWidth(byte[] destination, int destinationIndex, int width, long value); static byte getByte(byte[] bytes, int index); static short getUByte(byte[] bytes, int index); static short getShort(byte[] bytes, int index); static int getUShort(byte[] bytes, int index); static int getMediumInt(byte[] bytes, int index); static int getUMediumInt(byte[] bytes, int index); static int getInt(byte[] bytes, int index); static long getUInt(byte[] bytes, int index); static long getLong(byte[] bytes, int index); static BigInteger getULong(byte[] bytes, int index); static void putByte(byte[] bytes, int index, int value); static void putShort(byte[] bytes, int index, int value); static void putMediumInt(byte[] bytes, int index, int value); static void putInt(byte[] bytes, int index, int value); static void putLong(byte[] bytes, int index, long value); static String dump(byte[] b, int offset, int size); static String hex(byte[] bytes, int start, int length); static StringBuilder hex(StringBuilder sb, long value, int length); static void hex(AkibanAppender sb, byte[] bytes, int start,
            int length); static void printRuntimeInfo(); final static boolean cleanUpDirectory(final File file); final static boolean cleanUpFiles(final File[] files); static String decodeMySQLString(byte[] bytes, final int offset,
            final int width, final FieldDef fieldDef); static ByteSource byteSourceForMySQLString(byte[] bytes, final int offset,
                                                      final int width, final FieldDef fieldDef); static ByteBuffer byteBufferForMySQLString(byte[] bytes, final int offset,
                                           final int width, final FieldDef fieldDef); static int varWidth(final int length); static boolean equals(final Object a, final Object b); static int hashCode(final Object o); final static String NEW_LINE; }