예제 #1
0
 public NSOutputStream(ByteBuffer bytes) {
   super((SkipInit) null);
   if (bytes == null) {
     throw new NullPointerException("bytes");
   }
   long handle = NSData.getEffectiveAddress(bytes) + bytes.position();
   initObject(init(handle, bytes.remaining()));
   addStrongRef(bytes);
 }
    public void uploadData() throws IOException {
      DataOutputStream dos;

      request.setDoInput(true); // Allow Inputs
      request.setDoOutput(true); // Allow Outputs
      request.setUseCaches(false); // Don't use a Cached Copy
      request.setChunkedStreamingMode(1024);
      request.setRequestMethod("POST");
      request.setRequestProperty("connection", "Keep-Alive");
      request.setRequestProperty("ENCTYPE", "multipart/form-data");

      dos = new DataOutputStream(request.getOutputStream());
      byte[] databyte = data.bytes();

      dos.write(databyte);

      dos.flush();
      dos.close();
    }
예제 #3
0
 public long write(ByteBuffer bytes) {
   long handle = NSData.getEffectiveAddress(bytes) + bytes.position();
   return write(handle, bytes.remaining());
 }