Here you can find the source of deleteSpaceLatin(byte[] b)
public static void deleteSpaceLatin(byte[] b)
//package com.java2s; public class Main { public static void deleteSpaceLatin(byte[] b) { int count = 0; int len = b.length; for (int i = 0; i < len; i++) { int ch = b[i] & 0xff; if (ch == '\0') { count = count + len - i; break; } else if (ch == 0x20) { count++;/*from ww w. ja va2s .c om*/ } else { b[i - count] = (byte) ch; } } if (count > 0) { for (int i = len - count; i < len; i++) { b[i] = '\0'; } } } }