Package java.io

Examples of java.io.DataOutputStream.writeUTF()


                    java.util.Arrays.sort(fds, compareByName);

                for (int i = 0; i < fds.length; i++) {
                    FieldDescriptor f = fds[i];
                    out.writeUTF(f.getJavaName());
                    out.writeUTF(makeSignature(f.getType()));
                }

                /*
                 * Field[] fields = type.getDeclaredFields ();
                 *
 
View Full Code Here


        try {
            out = new DataOutputStream(response.getOutputStream());
            // 0) an int, the version of this datastream format - REMOTE_DEPLOY_RESPONSE_VER
            out.writeInt(REMOTE_DEPLOY_RESPONSE_VER);
            // 1) a UTF string, the status (should be "OK")
            out.writeUTF(status);
            if (filesCreated == fileCount) {
                // 2) an int, the number of files received
                out.writeInt(fileCount);
                // 3) for each file:
                for (int i = 0; i < names.length; i++) {
View Full Code Here

                // 2) an int, the number of files received
                out.writeInt(fileCount);
                // 3) for each file:
                for (int i = 0; i < names.length; i++) {
                    // 3.1) a UTF String, the path to the file as saved to the server's filesystem
                    out.writeUTF(names[i]);
                }
                // x) new data would be added here
                // only send newer data depending on the REQUEST_VER that came in
            } else {
                // error occurred, so don't send back any filenames, just a zero count
View Full Code Here

     */
  void sendMessage(int port, final String msg, final String expectedResponse) throws IOException {
      Socket socket = new Socket((String) null, port);
      DataInputStream reader = new DataInputStream(socket.getInputStream());
      DataOutputStream writer = new DataOutputStream(socket.getOutputStream());
      writer.writeUTF(msg);
      String response = reader.readUTF();
      assertEquals(expectedResponse, response);
      reader.close();
      writer.close();
      socket.close();
View Full Code Here

            Field[] fields = (Field[])fieldList.toArray(new Field[fieldList.size()]);
            Arrays.sort(fields, FieldByNameComparator.SINGLETON);
            for (int i = 0; i < vt.fields.length; i++)
            {
                Field f = fields[i];
                data.writeUTF(f.getName());
                data.writeUTF(JavaClass.getSignature(f.getType()));
            }
            data.flush();
            byte[] hasharray = md.digest();
            for (int i = 0; i < Math.min(8, hasharray.length); i++)
View Full Code Here

            Arrays.sort(fields, FieldByNameComparator.SINGLETON);
            for (int i = 0; i < vt.fields.length; i++)
            {
                Field f = fields[i];
                data.writeUTF(f.getName());
                data.writeUTF(JavaClass.getSignature(f.getType()));
            }
            data.flush();
            byte[] hasharray = md.digest();
            for (int i = 0; i < Math.min(8, hasharray.length); i++)
            {
View Full Code Here

            try
            {
                dos.writeInt(arguments.size());
                for(Map.Entry<String,String> arg : arguments.entrySet())
                {
                    dos.writeUTF(arg.getKey());
                    dos.writeUTF(arg.getValue());
                }
            }
            catch (IOException e)
            {
View Full Code Here

            {
                dos.writeInt(arguments.size());
                for(Map.Entry<String,String> arg : arguments.entrySet())
                {
                    dos.writeUTF(arg.getKey());
                    dos.writeUTF(arg.getValue());
                }
            }
            catch (IOException e)
            {
                // This should never happen
View Full Code Here

        dos.writeInt(size);
        dos.writeInt(dimensions);

        int wordCount = 0;
        for (String word : words) {
            dos.writeUTF(word);
            if (LOGGER.isLoggable(Level.INFO)) {
                LOGGER.info(String.format("serializing binary %d/%d: %s",
                              wordCount++, size, word));
            }
View Full Code Here

        dos.writeInt(size);
        dos.writeInt(dimensions);

        int wordCount = 0;
        for (String word : words) {
            dos.writeUTF(word);
            if (LOGGER.isLoggable(Level.INFO)) {
                LOGGER.info(String.format("serializing sparse binary %d/%d: %s",
                              wordCount++, size, word));
            }
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.