Package java.io

Examples of java.io.DataOutputStream.writeBytes()


      try {
        // write data to a byte array and then ask super to convert to pMedium
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        DataOutputStream writeOut = new DataOutputStream(out);
        for (int i = 0, length = myTypes.length; i < length; i++) {
          writeOut.writeBytes(myTypes[i].linkURL);
          writeOut.writeBytes("\n");
          writeOut.writeBytes(myTypes[i].linkText);
        }
        byte[] buffer = out.toByteArray();
        writeOut.close();
View Full Code Here


        // write data to a byte array and then ask super to convert to pMedium
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        DataOutputStream writeOut = new DataOutputStream(out);
        for (int i = 0, length = myTypes.length; i < length; i++) {
          writeOut.writeBytes(myTypes[i].linkURL);
          writeOut.writeBytes("\n");
          writeOut.writeBytes(myTypes[i].linkText);
        }
        byte[] buffer = out.toByteArray();
        writeOut.close();
View Full Code Here

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        DataOutputStream writeOut = new DataOutputStream(out);
        for (int i = 0, length = myTypes.length; i < length; i++) {
          writeOut.writeBytes(myTypes[i].linkURL);
          writeOut.writeBytes("\n");
          writeOut.writeBytes(myTypes[i].linkText);
        }
        byte[] buffer = out.toByteArray();
        writeOut.close();

        super.javaToNative(buffer, transferData);
View Full Code Here

        String boundary = UUID.randomUUID().toString();
        conn.setRequestProperty("Content-Type", "multipart/form-data;boundary="+boundary);
        conn.connect();
        DataOutputStream out = new DataOutputStream(conn.getOutputStream());
        out.writeBytes("--" + boundary + "--\r\n");
        out.writeBytes("Content-Disposition: form-data; name=\"upload\";"
                + " filename=\"" + fileName +"\"\r\n\r\n");
        IOUtils.copyAndCloseInput(in, out);
        out.writeBytes("\r\n--" + boundary + "--\r\n");
        out.close();
        int code = conn.getResponseCode();
View Full Code Here

        DataOutputStream out = new DataOutputStream(conn.getOutputStream());
        out.writeBytes("--" + boundary + "--\r\n");
        out.writeBytes("Content-Disposition: form-data; name=\"upload\";"
                + " filename=\"" + fileName +"\"\r\n\r\n");
        IOUtils.copyAndCloseInput(in, out);
        out.writeBytes("\r\n--" + boundary + "--\r\n");
        out.close();
        int code = conn.getResponseCode();
        if (code != HttpURLConnection.HTTP_OK) {
            throw new IOException("Result code: " + code);
        }
View Full Code Here

        DataOutputStream dos = new DataOutputStream(baos);

        try {
            int pixel, count, i, lastCount;
            if (!rawbits) {
                dos.writeBytes(regularMagicNumber);
                dos.writeBytes(" " + width);
                dos.writeBytes(" " + height);
                dos.writeBytes(" " + MAX_COLOR_VALUE + "\n");
                count = 0; // Keep lines less that 70 characters long
View Full Code Here

        try {
            int pixel, count, i, lastCount;
            if (!rawbits) {
                dos.writeBytes(regularMagicNumber);
                dos.writeBytes(" " + width);
                dos.writeBytes(" " + height);
                dos.writeBytes(" " + MAX_COLOR_VALUE + "\n");
                count = 0; // Keep lines less that 70 characters long

                // Keep track of the number of characters added per
View Full Code Here

        try {
            int pixel, count, i, lastCount;
            if (!rawbits) {
                dos.writeBytes(regularMagicNumber);
                dos.writeBytes(" " + width);
                dos.writeBytes(" " + height);
                dos.writeBytes(" " + MAX_COLOR_VALUE + "\n");
                count = 0; // Keep lines less that 70 characters long

                // Keep track of the number of characters added per
                // pass
View Full Code Here

            int pixel, count, i, lastCount;
            if (!rawbits) {
                dos.writeBytes(regularMagicNumber);
                dos.writeBytes(" " + width);
                dos.writeBytes(" " + height);
                dos.writeBytes(" " + MAX_COLOR_VALUE + "\n");
                count = 0; // Keep lines less that 70 characters long

                // Keep track of the number of characters added per
                // pass
                lastCount = 0;
View Full Code Here

                    pixel = data[i];
                    int r = (pixel >>> 16) & 0x000000FF;
                    int g = (pixel >>> 8) & 0x000000FF;
                    int b = (pixel) & 0x000000FF;

                    dos.writeBytes(" " + r);
                    dos.writeBytes(" " + g);
                    dos.writeBytes(" " + b);
                    if (count > 57) {
                        dos.writeBytes("\n");
                        count = 0;
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.