Read a buffer from the bundle
322863
function decodeBuffer( bundle, len, buf_type ) {
	var length=0, ans="";
	switch (len) {
		case 0: length = bundle.u8[bundle.i8++]; break;
		case 1: length = bundle.u16[bundle.i16++]; break;
		case 2: length = bundle.u32[bundle.i32++]; break;
		case 3: length = bundle.f64[bundle.i64++]; break;
	}

	// Process buffer according to type
	if (buf_type === 0) { // STRING_LATIN
		ans = String.fromCharCode.apply(null, bundle.readTypedArray( NUMTYPE.UINT8 , length ) );
		return DEBUG
			? __debugMeta( ans, 'string.latin', {} )
			: ans;

	} else if (buf_type === 1) { // STRING_UTF8
		ans = String.fromCharCode.apply(null, bundle.readTypedArray( NUMTYPE.UINT16 , length ) );
		return DEBUG
			? __debugMeta( ans, 'string.utf8', {} )
			: ans;

	} else if (buf_type === 2) { // IMAGE
		var img = document.createElement('img');
		img.src = decodeBlobURL( bundle, length );
		return img;

	} else if (buf_type === 4) { // SCRIPT
		var img = document.createElement('script');
		img.src = decodeBlobURL( bundle, length );
		return img;

	} else if (buf_type === 7) { // RESOURCE
		return decodeBlobURL( bundle, length );

	} else {
		throw new Errors.AssertError('Unknown buffer type #'+buf_type+'!');
	}

}
555411
private ByteBuf buffer(int i) {
        ByteBuf b = buffers[i];
        return b instanceof Component ? ((Component) b).buf : b;
    }
673738
public void read(byte[] buffer) throws IOException {
        IO.read(src, buffer);
        ofs += buffer.length;
    }
712911
function toBuffer (typed) {
        var ab = typed.buffer;
        var buffer = new Buffer(ab.byteLength);
        var view = new Uint8Array(ab);
        for (var i = 0; i < buffer.length; ++i) {
            buffer[i] = view[i];
        }
        return buffer;
    }
499710
function readAndSaveFileListing(bundle) {
		debugLS('in readAndSaveFileListing');
		var defered = q.defer();
		self.readArray('FILE_IO_NAME_READ', bundle.FILE_IO_NAME_READ_LEN.val)
		.then(function(fileNameChars) {
			debugLS('in readAndSaveFileListing raw', fileNameChars);
			var fileName = '';
			fileNameChars.forEach(function(fileNameChar) {
				if(fileNameChar !== 0) {
					fileName += String.fromCharCode(fileNameChar);
				}
			});
			// Save the file name.
			if(!bundle.noFilesOnCard) {
				bundle.fileNames.push(fileName);
			}
			debugLS('Debug CWD:', bundle.cwd, fileName);
			var filePath = path.posix.join(bundle.cwd, fileName);
			var pathInfo = path.posix.parse(filePath);
			var fileInfo = {
				'name': fileName,
				'ext': pathInfo.ext,
				'path': filePath,
				'pathInfo': pathInfo,
				'isDirectory': bundle.FILE_IO_ATTRIBUTES.isDirectory,
				'isFile': bundle.FILE_IO_ATTRIBUTES.isFile,
				'size': bundle.FILE_IO_SIZE.val,
				'sizeStr': bundle.FILE_IO_SIZE.str,
			};
			// Save the file's info.
			if(!bundle.noFilesOnCard) {
				bundle.files.push(fileInfo);
			}
			
			debugLS('in readAndSaveFileListing fileInfo', fileInfo);
			defered.resolve(bundle);
		}, function(err) {
			debugLS('in readAndSaveFileListing err', err);
			bundle.isError = true;
			bundle.errorStep = 'readAndSaveFileListing';
			bundle.error = modbusMap.getErrorInfo(err);
			bundle.errorCode = err;
			defered.reject(bundle);
		});
		return defered.promise;
	}
658688
def read(self, ulBuffer, pDst, unBytes):
        """"""

        fn = self.function_table.read
        punRead = c_uint32()
        result = fn(ulBuffer, pDst, unBytes, byref(punRead))
        return result, punRead.value
282155
private int readFromStream(byte[] buffer, int index, int bufferSize_) {
        int bytes;
        try {
            bytes = oggBitStream_.read(buffer, index, bufferSize_);
        } catch (Exception e) {
            LOG.log(Level.FINE, "Cannot Read Selected Song");
            bytes = -1;
        }
        currentBytes = currentBytes + bytes;
        return bytes;
    }
1170873
def _read_bytes(fp, buf):
    

    # Do the first read without resizing the input buffer
    offset = 0
    remaining = len(buf)
    while remaining > 0:
        l = fp.readinto((ctypes.c_char * remaining).from_buffer(buf, offset))
        if l is None or l == 0:
            return offset
        offset += l
        remaining -= l
    return offset
96347
def read(self, mode='r', *, buffering=-1, encoding=None, newline=None):
        '''  '''
        with self.open(mode=mode, buffering=buffering, encoding=encoding, newline=newline) as fp:
            return fp.read()
961088
function read_buffer(){
	var to_eval = jQuery('#' + command_buffer.get_id()).val();
	if( to_eval != '' ){
	    log('// Evaluating buffer...');
	    var evals = _evaluate(to_eval);
	    log('// ' + evals[1]);
	    _advance_log_to_bottom();
	}
    }
637740
function infoBuffer(buf, cb) {
  try {
    buf = bufferUtils.toBuffer(buf);
    info(buf, cb);
  } catch(err) {
    cb(err);
  }
}
691145
public int read(Pointer buf, JechtIO.Str str, int max_size, int skip) {
        int len = 0;
        max_size -= skip;
        if(max_size <= 0) {
            max_size = 0;
        } else {
            IRubyObject src = port;
            IRubyObject n = RubyNumeric.int2fix(port.getRuntime(), max_size);
            IRubyObject str2 = src.callMethod(port.getRuntime().getCurrentContext(), "read", n);
            if(!str2.isNil()) {
                ByteList res = str2.convertToString().getByteList();
                len = res.realSize;
                System.arraycopy(res.bytes, res.begin, buf.buffer, buf.start+skip, len);
            }
        }
        len += skip;
        buf.buffer[buf.start+len] = 0;
        return len;
    }
899611
def _frombuffer(ptr, frames, channels, dtype):
    """"""
    framesize = channels * dtype.itemsize
    data = np.frombuffer(ffi.buffer(ptr, frames * framesize), dtype=dtype)
    data.shape = -1, channels
    return data
728815
function (filePath,buffer)
		{
			if (!_.isString(filePath))
				done.reject(false);
			else {
				var realPath = done.promise.filePath = this.instanceOf('wnModule')?this.modulePath+filePath:filePath;
				done.promise.returnAsBuffer=buffer=buffer || true;

				fs.readFile(realPath,function (err,text) {
					if (err)
						done.reject(err);
					else
					{
						if (!buffer)
							text=text.toString('utf8');
						done.resolve(text);
					}
				});
			}

			return done.promise;
		}
897435
function loadFromBuffer(input) {
  var buf = new BunserBuf();
  var result = buf.append(input, true);
  if (buf.buf.readAvail()) {
    throw Error(
        'excess data found after input buffer, use BunserBuf instead');
  }
  if (typeof result === 'undefined') {
    throw Error(
        'no bser found in string and no error raised!?');
  }
  return result;
}
90311
def buffer(self, data):
        '''
        
        '''
        self._read_lock.acquire()
        try:
            return super(GeventTransport, self).buffer(data)
        finally:
            self._read_lock.release()
329347
def read(self):
        
        """
        # Read until we have a \0 in our buffer.
        while b'\0' not in self._recv_buffer:
            self._recv_buffer += yield From(_read_chunk_from_socket(self.socket))

        # Split on the first separator.
        pos = self._recv_buffer.index(b'\0')

        packet = self._recv_buffer[:pos]
        self._recv_buffer = self._recv_buffer[pos + 1:]

        raise Return(packet)