Code example for DataInputStream

Methods: readBoolean, readByte

0
    /** 
     * Abstract. Reads the raw packet data from the data stream. 
     */ 
    public void readPacketData(DataInputStream par1DataInputStream) throws IOException
    { 
        this.windowId = par1DataInputStream.readByte() & 255;
        this.inventoryType = par1DataInputStream.readByte() & 255;
        this.windowTitle = readString(par1DataInputStream, 32);
        this.slotsCount = par1DataInputStream.readByte() & 255;
        this.field_94500_e = par1DataInputStream.readBoolean();
    } 
 
    /** 
     * Abstract. Writes the raw packet data to the data stream. 
     */ 
    public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException
    { 
        par1DataOutputStream.writeByte(this.windowId & 255);
        par1DataOutputStream.writeByte(this.inventoryType & 255);
        writeString(this.windowTitle, par1DataOutputStream);
        par1DataOutputStream.writeByte(this.slotsCount & 255);