Here you can find the source of extractPacket(String serverPacket)
Parameter | Description |
---|---|
serverPacket | - packet received from server |
String
that contains all the valuable information
public static ArrayList<String> extractPacket(String serverPacket)
//package com.java2s; /*************************************************************** * Licensed Materials - Property of breadbox * * (c) Copyright breadbox 2014 - All Rights Reserved * ***************************************************************/ import java.util.ArrayList; public class Main { /**/*from w ww . j av a 2s . c o m*/ * Extracts the valuable information from a packet and cuts out the initial * hashtag identifier * * @param serverPacket * - packet received from server * @return An array of <code>String</code> that contains all the valuable * information */ public static ArrayList<String> extractPacket(String serverPacket) { ArrayList<String> extractedPacket = new ArrayList<String>(); String[] tmp = serverPacket.split("#"); /* * Ignore tmp[0] which is white space and tmp[1] which is the hashtag * identifier #...# */ for (int i = 2; i < tmp.length; i++) { extractedPacket.add(tmp[i]); } return extractedPacket; } }