ByteUtil { public static String maxString(String value, int size) { if (value.length() < size) { return value; } else { return value.substring(0, size / 2) + " ... " + value.substring(value.length() - size / 2); } }  static void debugFrame(Logger logger, String message, ByteBuf byteIn); static String formatGroup(String str, int groupSize, int lineBreak); static String maxString(String value, int size); static String bytesToHex(byte[] bytes); static String debugByteArray(byte[] byteArray); static String byteToChar(byte value); static String bytesToHex(byte[] bytes, int groupSize); static String toSimpleString(byte[] bytes); static final byte[] intToBytes(int value); static int bytesToInt(byte[] b); static byte[] longToBytes(long value); static void longToBytes(long x, byte[] output, int offset); static byte[] doubleLongToBytes(long value1, long value2); static byte[] hexToBytes(String hexStr); static String readLine(ActiveMQBuffer buffer); static long convertTextBytes(final String text); static boolean equals(final byte[] left, final byte[] right); static boolean equals(final byte[] left,
                                final byte[] right,
                                final int rightOffset,
                                final int rightLength); static boolean equals(final byte[] bytes, final ByteBuf byteBuf, final int offset, final int length); static int intFromBytes(byte b1, byte b2, byte b3, byte b4); static void zeros(final ByteBuffer buffer); static void zeros(final ByteBuffer buffer, int offset, int bytes); static String getHumanReadableByteCount(long bytes); static final String NON_ASCII_STRING; }
@Test public void testMaxString() { byte[] byteArray = new byte[20 * 1024]; log.debug(ByteUtil.maxString(ByteUtil.bytesToHex(byteArray, 2), 150)); }