Code example for DataOutputStream

Methods: write, writeShort

0
		return _data[pos + _start];
	} 
 
	@Override 
	public void writeToDataOutputStream(DataOutputStream stream) throws IOException {
		stream.writeShort(_length);
		stream.write(_data, _start, _length);
	} 
 
	@Override 
	public String toString() {
		if (this._length > 50) {
			return "Buffer {"+this._length+ '}';
		} else { 
			StringBuilder b = new StringBuilder(this._length*3);
            b.append('{').append(this._length).append(':');
			for (int x=0; x<this._length; x++) {
				b.append(byteAt(x));
				b.append(' ');
			} 
			return b.toString();