Code example for DataInputStream

Methods: readBytereadIntreadShort

0
    /** 
     * Abstract. Reads the raw packet data from the data stream. 
     */ 
    public void readPacketData(DataInputStream par1DataInputStream) throws IOException
    { 
        this.entityId = par1DataInputStream.readInt();
        this.effectId = par1DataInputStream.readByte();
        this.effectAmplifier = par1DataInputStream.readByte();
        this.duration = par1DataInputStream.readShort();
    } 
 
    /** 
     * 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);
Stop searching for code, let great code find you!  Add Codota to your java IDE