wrapper for external calls (do not return inner buffer directly to prevent it's modifying)
191415
function (length, byteOffset, littleEndian, toArray) {
		var result = this._getBytes(length, byteOffset, defined(littleEndian, true));
		return toArray ? arrayFrom(result) : result;
	}
796160
function isExternalDirectCall (node) {
  return isMemberAccess(node, basicRegex.EXTERNALFUNCTIONTYPE, undefined, basicRegex.CONTRACTTYPE, undefined) && !isThisLocalCall(node) && !isSuperLocalCall(node)
}
516805
function BufferedStream(opts) {
  opts = opts || {}

  Stream.call(this)

  // up to subclasses to decide what kind of stream we are
  this.writable = false
  this.readable = false

  this.buffers = []
  this.paused = false
  this.concat = !!opts.concat //boolean indicating if we should emit separate buffers or concat buffers into one 'emit' event
}
1138655
def _raw_object_cache_getbuffer(self, data):
        
        if self._object_cache_getbuffer is None:
            return
        module_ptr = data.contents.module_ptr
        module = self._find_module_ptr(module_ptr)
        if module is None:
            # The LLVM EE should only give notifications for modules
            # known by us.
            raise RuntimeError("object compilation notification "
                               "for unknown module %s" % (module_ptr,))

        buf = self._object_cache_getbuffer(module)
        if buf is not None:
            # Create a copy, which will be freed by the caller
            data[0].buf_ptr = ffi.lib.LLVMPY_CreateByteString(buf, len(buf))
            data[0].buf_len = len(buf)
520658
@Override
    public void writeExternal(ObjectOutput s) throws IOException {
        if (!removedFromLeakDetection) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc,
                         "Buffer being serialized but removeFromLeakDetection has not been called: " + this);
            }
        }

        if (oByteBuffer.isDirect()) {
            // hard code as local strings to help performance.
            // Strings are used here and and in the readObject routines
            s.writeObject("D");
        } else {
            s.writeObject("ND");
        }
        if (oByteBuffer.order() == java.nio.ByteOrder.BIG_ENDIAN) {
            s.writeObject("B");
        } else {
            s.writeObject("L");
        }

        int startPosition = oByteBuffer.position();
        int startLimit = oByteBuffer.limit();

        // set position to 0 and limit to capacity, so we can serialize
        // the entire buffer
        this.oByteBuffer.position(0);
        this.oByteBuffer.limit(this.oByteBuffer.capacity());

        if (oByteBuffer.hasArray() && oByteBuffer.arrayOffset() == 0) {
            s.writeObject(oByteBuffer.array());
        } else {
            byte[] bytes = new byte[oByteBuffer.limit()];
            this.oByteBuffer.get(bytes);
            s.writeObject(bytes);
        }

        this.oByteBuffer.position(startPosition);
        this.oByteBuffer.limit(startLimit);

        s.writeObject(Integer.toString(startPosition));
        s.writeObject(Integer.toString(startLimit));

        if (this.readOnly) {
            s.writeObject("R");
        } else {
            s.writeObject("RW");
        }
    }
782994
void process(ByteChannel sock, AutoBuffer ab) throws IOException {
        int requestType = ab.get1();
        switch (requestType) {
            case CREATE_FRAME:
                ExternalFrameWriterBackend.handleWriteToChunk(sock, ab);
                break;
            case DOWNLOAD_FRAME:
                ExternalFrameReaderBackend.handleReadingFromChunk(sock, ab);
                break;
        }
    }
541219
def ctypes2buffer(cptr, length):
    """"""
    if not isinstance(cptr, ctypes.POINTER(ctypes.c_char)):
        raise RuntimeError('expected char pointer')
    res = bytearray(length)
    rptr = (ctypes.c_char * length).from_buffer(res)
    if not ctypes.memmove(rptr, cptr, length):
        raise RuntimeError('memmove failed')
    return res
599923
function(rawBuffer) {
    if (rawBuffer && this.offset === 0) return this.buffer;

    var out = new Buffer(8);
    this.buffer.copy(out, 0, this.offset, this.offset + 8);
    return out;
  }
467176
def extern_store_bytes(self, context_handle, bytes_ptr, bytes_len):
    """"""
    c = self._ffi.from_handle(context_handle)
    return c.to_value(binary_type(self._ffi.buffer(bytes_ptr, bytes_len)))
1374586
function bufferFrom(data, enc) {
  if (typeof Buffer.from == 'function') {
    return Buffer.from(data, enc);
  } else {
    return new Buffer(data, enc);
  }
}
861612
def write_render_callable(self, node, name, args, buffered, filtered,
            cached):
        """"""

        if self.in_def:
            decorator = node.decorator
            if decorator:
                self.printer.writeline(
                                "@runtime._decorate_toplevel(%s)" % decorator)

        self.printer.start_source(node.lineno)
        self.printer.writelines(
            "def %s(%s):" % (name, ','.join(args)),
                # push new frame, assign current frame to __M_caller
                "__M_caller = context.caller_stack._push_frame()",
                "try:"
        )
        if buffered or filtered or cached:
            self.printer.writeline("context._push_buffer()")

        self.identifier_stack.append(
                                self.compiler.identifiers.branch(self.node))
        if (not self.in_def or self.node.is_block) and '**pageargs' in args:
            self.identifier_stack[-1].argument_declared.add('pageargs')

        if not self.in_def and (
                                len(self.identifiers.locally_assigned) > 0 or
                                len(self.identifiers.argument_declared) > 0
                                ):
            self.printer.writeline("__M_locals = __M_dict_builtin(%s)" %
                                    ','.join([
                                            "%s=%s" % (x, x) for x in
                                            self.identifiers.argument_declared
                                            ]))

        self.write_variable_declares(self.identifiers, toplevel=True)

        for n in self.node.nodes:
            n.accept_visitor(self)

        self.write_def_finish(self.node, buffered, filtered, cached)
        self.printer.writeline(None)
        self.printer.write_blanks(2)
        if cached:
            self.write_cache_decorator(
                                node, name,
                                args, buffered,
                                self.identifiers, toplevel=True)
84691
def consume_remaining_buffer(stack, buf)
      return if buf.length == 0
      stack << buf.dup
      buf.replace('')
    end
530180
private DataBuffer withDataBufferFactory(ByteBufHttpData data) {
        final byte[] dataArray = ByteBufUtil.getBytes(data.content());
        data.release();
        return delegate.wrap(dataArray);
    }
689494
private ByteBuffer ensureBuffer(int size, ByteBuffer buffer, WritableByteChannel output) throws IOException {
    if(buffer.remaining() >= size) {
      return buffer;
    }
    flushBuffer(buffer, output);
    if(buffer.remaining() >= size) {
      return buffer;
    }
    // Aggressively grow the buffer
    return ByteBuffer.allocateDirect(Math.max(buffer.capacity() << 1, buffer.capacity() + size));
  }
1011335
@Override public void readExternal( ObjectInput ois )  throws IOException, ClassNotFoundException {
    int x = ois.readInt();
    byte[] buf = MemoryManager.malloc1(x);
    ois.readFully(buf);
    read(new AutoBuffer(buf));
  }
622177
def _render(template, callable_, args, data, as_unicode=False):
    """"""

    if as_unicode:
        buf = util.FastEncodingBuffer(as_unicode=True)
    elif template.bytestring_passthrough:
        buf = compat.StringIO()
    else:
        buf = util.FastEncodingBuffer(
                        as_unicode=as_unicode,
                        encoding=template.output_encoding,
                        errors=template.encoding_errors)
    context = Context(buf, **data)
    context._outputting_as_unicode = as_unicode
    context._set_with_template(template)

    _render_context(template, callable_, context, *args,
                            **_kwargs_for_callable(callable_, data))
    return context._pop_buffer().getvalue()
215680
function processAsBuffer( file ) {
	return function( callback ) {
		var json = JSON.parse(file.contents);
		callback( json, path.dirname(file.path) );
	}
}