FileDocCategorySizeDatePackage
UDataInputStream.javaAPI DocAndroid 1.5 API1819Wed May 06 22:41:16 BST 2009com.vladium.jcd.lib

UDataInputStream

public final class UDataInputStream extends DataInputStream
A trivial extension to java.io.DataInputStream to provide methods for reading unsigned 16- and 32-bit integers with simple mnemonics. It uses correspondingly wider native types to preserve the full range of the unsigned types.
author
(C) 2001, Vlad Roubtsov

Fields Summary
Constructors Summary
public UDataInputStream(InputStream _in)

        super (_in);
    
Methods Summary
public final intreadU2()

        final short value = readShort ();
        
        return ((int) value) & 0xFFFF; // widening cast sign-extends
    
public final longreadU4()

        final int value = readInt ();
        
        return ((long) value) & 0xFFFFFFFFL; // widening cast sign-extends