Code example for DataOutputStream

Methods: writeByte, writeInt, writeShort

0
    /** 
     * Abstract. Writes the raw packet data to the data stream. 
     */ 
    public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException
    { 
        par1DataOutputStream.writeInt(this.entityId);
        par1DataOutputStream.writeByte(this.effectId);
        par1DataOutputStream.writeByte(this.effectAmplifier);
        par1DataOutputStream.writeShort(this.duration);
    } 
 
    /** 
     * Passes this Packet on to the NetHandler for processing. 
     */ 
    public void processPacket() 
    { 
    } 
 
    /** 
     * Abstract. Return the size of the packet (not counting the header). 
     */