All pastes #760631 Raw Edit

Anonymous

public java v1 · immutable
·published 2007-11-04 04:26 UTC
rendered paste body
    public static World[] getWorlds() throws IOException {        DataInputStream in = new DataInputStream(new URL(                "http://www.runescape.com/slr.ws?order=WMLPA").openStream());        in.skip(4);        World[] worlds = new World[in.readShort()];        for (int i = 0; i < worlds.length; i++) {            int j = in.readShort();            StringBuffer prefix = new StringBuffer();            byte b = -1;            while ((b = in.readByte()) != 0)                prefix.append((char) b);            worlds[i] = new World(j & 0x7FFF, prefix.toString(),                                  (j & 0x8000) != 0, in.readShort());        }        return worlds;    }