Code example for DataInputStream

Methods: readIntreadShort

0
        return ID;
    } 
 
    @Override 
    public void decode( DataInputStream in ) throws IOException {
        eid       = in.readInt();
        velocityX = in.readShort();
        velocityY = in.readShort();
        velocityZ = in.readShort();
    } 
 
    @Override 
    public void encode( DataOutputStream out ) throws IOException {
        out.writeInt( eid );
        out.writeShort( velocityX );
        out.writeShort( velocityY );
        out.writeShort( velocityZ );
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java