FileDocCategorySizeDatePackage
DataIO.javaAPI DocExample883Fri Jan 11 10:39:30 GMT 2002com.darwinsys.util

DataIO

public class DataIO extends Object
Some I-O primitives for datastreams. All methods are static, since there is no state.
version
$Id: DataIO.java,v 1.1 2002/01/11 15:39:31 ian Exp $

Fields Summary
Constructors Summary
private DataIO()
Nobody should need to create an instance; all methods are static

 
Methods Summary
public static longreadUnsignedInt(java.io.DataInput is)
Read an unsigned int from a DataInput

param
is DataInput (DataInputStream, RandomAccessFile, etc).
return
long, to hold an unsigned int.

		// Need to read 4 bytes from the input, unsigned.
		// Do it yourself; there is no readUnsignedInt().
		return
			((long)(is.readUnsignedByte() & 0xff) << 24) |
			((long)(is.readUnsignedByte() & 0xff) << 16) |
			((long)(is.readUnsignedByte() & 0xff) <<  8) |
			((long)(is.readUnsignedByte() & 0xff) <<  0);