Package java.io

Examples of java.io.DataOutputStream.writeBytes()


                        case POST:
                            http.setDoOutput(true);
                            /* if there is something to put in the requestBody*/
                            if (requestBody != null && requestBody.length() >= 0) {
                                DataOutputStream wr = new DataOutputStream(http.getOutputStream());
                                wr.writeBytes(requestBody);
                                wr.flush();
                                wr.close();
                            }
                            break;
                    }
View Full Code Here


                case POST:
                    http.setDoOutput(true);
                    /* if there is something to put in the requestBody*/
                    if (this.requestBody != null && this.requestBody.length() >= 0) {
                        DataOutputStream wr = new DataOutputStream(http.getOutputStream());
                        wr.writeBytes(requestBody);
                        wr.flush();
                        wr.close();
                    }
                    break;
            }
View Full Code Here

        {
            for ( String s : keys )
            {
                Arrays.fill(buffer, (char)0);
                System.arraycopy( s.toCharArray(), 0, buffer, 0, s.length() );
                dos.writeBytes( new String(buffer) );
            }
        }
        catch  (IOException e)
        {
            System.err.println("Could not write Structure key set to byte array: " + e );
View Full Code Here

      DataOutputStream out = new DataOutputStream(conn.getOutputStream());
      String content = "u=" + URLEncoder.encode(from, "UTF-8") + "&t="
          + URLEncoder.encode(to, "UTF-8") + "&s="
          + URLEncoder.encode(subject, "UTF-8") + "&m="
          + URLEncoder.encode(message, "UTF-8");
      out.writeBytes(content);
      out.flush();
      out.close();
      // Get response data.
      DataInputStream in = new DataInputStream(conn.getInputStream());
      in.read();
View Full Code Here

        // Open a data output stream on the file to append metrics
        FileOutputStream fstream = new FileOutputStream(file, true);
        DataOutputStream out = new DataOutputStream(fstream);

        // Start with a marker so we can determine which PNG's are font textures
        out.writeBytes("FTX");
       
        // Write character|x|y|width|height|ascent for each glyph
        for ( int i = 0; i < chars.length; i++ ) {
            GlyphMetrics g = metrics[i];
            out.writeByte(chars[i]);
View Full Code Here

     
      Path a = new Path(dir, "a");
      Path b = new Path(dir, "b");

      DataOutputStream a_out = fs.create(a);
      a_out.writeBytes("something");

      Assert.assertTrue(hasLease(cluster, a));
      Assert.assertTrue(!hasLease(cluster, b));
     
      DataOutputStream b_out = fs.create(b);
View Full Code Here

      Assert.assertTrue(hasLease(cluster, a));
      Assert.assertTrue(!hasLease(cluster, b));
     
      DataOutputStream b_out = fs.create(b);
      b_out.writeBytes("something");

      Assert.assertTrue(hasLease(cluster, a));
      Assert.assertTrue(hasLease(cluster, b));

      a_out.close();
View Full Code Here

        "application/x-www-form-urlencoded");
    connection.setDoInput(true);
    connection.setDoOutput(true);
    connection.setInstanceFollowRedirects(true);
    DataOutputStream out = new DataOutputStream(connection.getOutputStream());
    out.writeBytes(postContent);
    out.flush();
    out.close();
    BufferedReader reader = new BufferedReader(new InputStreamReader(
        connection.getInputStream()));
    String line = reader.readLine();
View Full Code Here

        Integer.toString(postContent.getBytes().length));
    connection.setDoInput(true);
    connection.setDoOutput(true);
    connection.setInstanceFollowRedirects(true);
    DataOutputStream out = new DataOutputStream(connection.getOutputStream());
    out.writeBytes(postContent);
    out.flush();
    out.close();
    return connection.getInputStream();
  }
View Full Code Here

        __query.append(username);
        __query.append(SocketClient.NETASCII_EOL);

        output =
          new DataOutputStream(new BufferedOutputStream(_output_, 1024));
        output.writeBytes(__query.toString());
        output.flush();

        return _input_;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.