Code example for DataInput

Methods: readFullyreadShort

0
	 * @param dis to read bytes from 
	 * @throws IllegalArgumentException If the length integer is negative. 
	 * @throws IOException error reading from dis 
	 */ 
	public ShortBuffer(DataInput dis) throws IOException {
		_length = dis.readShort();
		if(_length < 0)
			throw new IllegalArgumentException("Negative Length: "+_length);
		_data = new byte[_length];
		_start = 0;
		dis.readFully(_data);
	} 
 
	/** 
	 * Create an empty Buffer */ 
	public ShortBuffer() { 
		_data = new byte[0];
		_start = 0;
		_length = 0;
	}