Upload raw data to this file as binary
@param data the data to upload
@throws APIException if there were any problems communicating with the Algorithmia API
192748
public void put(byte[] data) throws APIException {
        HttpResponse response = client.put(getUrl(), new ByteArrayEntity(data, ContentType.APPLICATION_OCTET_STREAM));
        HttpClientHelpers.throwIfNotOk(response);
    }
1292715
@Override
    public void add(final byte[] key, final byte[] data) throws IOException {
        this.datas.put(new BytesKey(key), data);
    }
465464
protected void writeByteArray(ObjectOutput output, byte[] data) throws IOException {
        if (null == data || 0 == data.length) {
            output.writeInt(-1);
        } else {
            output.writeInt(data.length);
            output.write(data);
        }
    }
567535
public void writeData(String data) {
        _buffer.append("<![CDATA[");
        _buffer.append( data);
        _buffer.append( "]]>");
    }
1332024
private String jsonifyData(Map<String, ? extends Object> data) {
        JSONObject jsonData = new JSONObject(data);

        return jsonData.toString();
    }
313614
protected void sendBinaryData(byte[] binaryData, String contentType,
      SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException {

    // set content type and length
    response.setContentType(contentType);
    response.setContentLength(binaryData.length);

    // Handling of the "force download" selector
    if (RequestPath.hasSelector(request, SELECTOR_DOWNLOAD)) {
      // Overwrite MIME type with one suited for downloads
      response.setContentType(ContentType.DOWNLOAD);

      // Construct disposition header
      StringBuilder dispositionHeader = new StringBuilder("attachment;");
      String suffix = request.getRequestPathInfo().getSuffix();
      suffix = StringUtils.stripStart(suffix, "/");
      if (StringUtils.isNotEmpty(suffix)) {
        dispositionHeader.append("filename=\"").append(suffix).append('\"');
      }

      response.setHeader(HEADER_CONTENT_DISPOSITION, dispositionHeader.toString());
    }

    // write binary data
    OutputStream out = response.getOutputStream();
    out.write(binaryData);
    out.flush();

  }
1343354
function appendData(data, builder) {
  if(Array.isArray(data) || Buffer.isBuffer(data)) {
    data = Buffer.from(data);
  } else {
    data = Buffer.from(data, 'ascii');
  }

  builder.appendBuffer(data);
}
1177844
public void setNodeData(byte[] nodeData)
    {
        this.nodeData = (nodeData != null) ? Arrays.copyOf(nodeData, nodeData.length) : null;
    }
617759
public void write(byte data) throws IOException {
    fos.write(data);
    if(position + 1 > size)
      size = position+1;
    position+= 1;
  }
883546
function(data, method) {

	var urlencodedForm = true;
	
	if (typeof data == 'string') {
		this.ioData = data;
	} else if (typeof data == 'object' && data._node) {

		if (data.getAttribute('enctype')) {
			urlencodedForm = false;
		}
		
		this.ioData = new FormData(data._node);
	}

	var req = this.req,
		method = method || 'POST';

	req.open(method, this.url);

	//Send the proper header information along with the request
	// Send as form encoded if we do not have a file field
	if (urlencodedForm) {
		req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	}

	return this._run();
}
872788
public static void writeToFile(final File fileNode, final byte[] data) throws FrameworkException, IOException {

		setFileProperties(fileNode);

		FileUtils.writeByteArrayToFile(fileNode.getFileOnDisk(), data);

	}
240044
public synchronized void insert(long data) {
        resetIfNeeded();
        long index = 0;
        if(data >= this.upperBound) {
            index = nBuckets - 1;
        } else if(data < 0) {
            logger.error(data + " can't be bucketed because it is negative!");
            return;
        } else {
            index = data / step;
        }
        if(index < 0 || index >= nBuckets) {
            // This should be dead code. Defending against code changes in
            // future.
            logger.error(data + " can't be bucketed because index is not in range [0,nBuckets).");
            return;
        }
        buckets[(int) index]++;
        sum += data;
        size++;
    }
409891
@POST
	@Path("/upload")
	@Consumes("multipart/form-data")
	@AllowSecurityBypassedByToken
	public void upload(MultipartFormDataInput input) throws IOException {
		Map<String, List<InputPart>> formDataMap = input.getFormDataMap();
		List<InputPart> inputParts = formDataMap.get("uploadedFile");

		for (InputPart inputPart : inputParts) {
			String fileName = getFileName(inputPart.getHeaders());
			InputStream inputStream = inputPart.getBody(InputStream.class, null);
			File file = File.createTempFile(HomeWS.class.getSimpleName(), ".tmp");
			IOUtils.copy(inputStream, new FileOutputStream(file));
			uploadedFiles.put(fileName, file);
		}
	}
439745
public void addFile(String zipEntry, byte[] data) throws IOException  {
		stream.putNextEntry(new ZipEntry(zipEntry));
		stream.write(data);
	}
1066249
@Override
    public boolean update(final byte[] key, final byte[] data) throws IOException {
        this.datas.put(new BytesKey(key), data);
        return true;
    }
467781
@SuppressWarnings("unchecked")
    public BaseBo fromByteArray(byte[] data) {
        Map<String, Object> dataMap = null;
        try {
            dataMap = data != null ? SerializationUtils.fromByteArray(data, Map.class) : null;
        } catch (Exception e) {
            dataMap = null;
        }
        return fromMap(dataMap);
    }
917101
public static byte[] newByteArray(byte[] data) {
        if (data == null) {
            throw new IllegalArgumentException("Data you want to copy are backed by null object.");
        }
        byte[] buffer = new byte[data.length];
        System.arraycopy(data, 0, buffer, 0, data.length);
        return buffer;
    }