public static byte[] getData(DataInputStream dis) throws IOException{ int length; byte[] data; length = dis.read(); data = new byte[length]; dis.read(data); return data; }