Code example for DataInputStream

Methods: read, readInt

0
    public byte yaw;
    public byte pitch;
 
    @Override 
    public void read(DataInputStream stream) throws IOException {
        super.read(stream);
        this.x = stream.readInt();
        this.y = stream.readInt();
        this.z = stream.readInt();
        this.yaw = (byte) stream.read();
        this.pitch = (byte) stream.read();
    } 
 
    @Override 
    public void write(DataOutputStream stream) throws IOException {
        super.write(stream);
        stream.writeInt(this.x);
        stream.writeInt(this.y);
        stream.writeInt(this.z);
        stream.write(this.yaw);
        stream.write(this.pitch);