Code example for DataInputStream

Methods: readBoolean, readByte, readInt

0
    /** 
     * Abstract. Reads the raw packet data from the data stream. 
     */ 
    public void readPacketData(DataInputStream par1DataInputStream) throws IOException
    { 
        this.sfxID = par1DataInputStream.readInt();
        this.posX = par1DataInputStream.readInt();
        this.posY = par1DataInputStream.readByte() & 255;
        this.posZ = par1DataInputStream.readInt();
        this.auxData = par1DataInputStream.readInt();
        this.field_82561_f = par1DataInputStream.readBoolean();
    } 
 
    /** 
     * Abstract. Writes the raw packet data to the data stream. 
     */ 
    public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException
    { 
        par1DataOutputStream.writeInt(this.sfxID);
        par1DataOutputStream.writeInt(this.posX);
        par1DataOutputStream.writeByte(this.posY & 255);