Package java.io

Examples of java.io.DataOutputStream.writeChar()


    } finally {
      dataXceiverServer.balanceThrottler.release();
      if (isOpSuccess) {
        try {
          // send one last byte to indicate that the resource is cleaned.
          reply.writeChar('d');
        } catch (IOException ignored) {
        }
      }
      IOUtils.closeStream(reply);
      IOUtils.closeStream(blockSender);
View Full Code Here


    } finally {
      dataXceiverServer.balanceThrottler.release();
      if (isOpSuccess) {
        try {
          // send one last byte to indicate that the resource is cleaned.
          reply.writeChar('d');
        } catch (IOException ignored) {
        }
      }
      IOUtils.closeStream(reply);
      IOUtils.closeStream(blockSender);
View Full Code Here

        out.writeInt(1); // This is the version

        String name = getWorldName();
        out.writeShort(name.length());
        for (int i = 0; i < name.length(); i++) {
          out.writeChar(name.charAt(i));
        }

        out.writeInt(minX);
        out.writeInt(maxX);
        out.writeInt(minZ);
View Full Code Here

            Player play = (Player) _players.elementAt(i);
            dos.writeInt(play.getNumber());
            dos.writeInt(play.getScore());
            char[] name = play.getPseudo().toCharArray();
            for (int j = 0; j < play.getPseudo().length(); j++) {
                dos.writeChar(name[j]);
            }
            if (play.getPseudo().length() < 5) {
                for (int j = play.getPseudo().length(); j < 5; j++) {
                    dos.writeChar(' ');
                }
View Full Code Here

            for (int j = 0; j < play.getPseudo().length(); j++) {
                dos.writeChar(name[j]);
            }
            if (play.getPseudo().length() < 5) {
                for (int j = play.getPseudo().length(); j < 5; j++) {
                    dos.writeChar(' ');
                }
            }
        }

        dos.flush();
View Full Code Here

    } finally {
      dataXceiverServer.balanceThrottler.release();
      if (isOpSuccess) {
        try {
          // send one last byte to indicate that the resource is cleaned.
          reply.writeChar('d');
        } catch (IOException ignored) {
        }
      }
      IOUtils.closeStream(reply);
      IOUtils.closeStream(blockSender);
View Full Code Here

    } finally {
      dataXceiverServer.balanceThrottler.release();
      if (isOpSuccess) {
        try {
          // send one last byte to indicate that the resource is cleaned.
          reply.writeChar('d');
        } catch (IOException ignored) {
        }
      }
      IOUtils.closeStream(reply);
      IOUtils.closeStream(blockSender);
View Full Code Here

      //System.out.print(" children: ");
      dos.writeShort(node.children.size());
      bytes += 2;
      for (char c: node.children.keySet()) {
        Node child = node.children.get(c);
        dos.writeChar(c);
        bytes += 2;
        dos.writeLong(child.pos);
        bytes += 8;
        //System.out.print(c + " " + child.pos + " ");
      }
View Full Code Here

              socket.getInputStream());
          String line = in.readUTF();
          System.out.println(line);
          DataOutputStream os = new DataOutputStream(
              socket.getOutputStream());
          os.writeChar(line.charAt(0));
          os.flush();
        } catch (IOException e) {
          e.printStackTrace();
        } finally {
          socket.close();
View Full Code Here

    DataOutputStream dos = new DataOutputStream(os);
    int bytesWritten = 0;

    bytesWritten += serializeHeader(dos);
    for (int i = 0; i < dataLength; i++) {
      dos.writeChar(index[data16 + i]);
    }
    bytesWritten += dataLength * 2;
    return bytesWritten;
  }

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.