Package java.io

Examples of java.io.DataInputStream.readChar()


          version = in.readInt(); // Read version
        }
        StringBuilder builder = new StringBuilder();
        short size = in.readShort();
        for (int i = 0; i < size; i++) {
          builder.append(in.readChar());
        }
        String name = builder.toString();
        if (!name.equals(getWorldName())) {
          System.out.println("World names do not match: " + name + " [file] != " + getWorldName() + " [game]. Compensating...");
          // TODO Compensate
View Full Code Here


                try {
                    int number = dis.readInt();
                    int score = dis.readInt();
                    char[] name = new char[5];
                    for (int j = 0; j < 5; j++) {
                        name[j] = dis.readChar();
                    }
                    String pseudo = new String(name);
                    Player play = new Player(number, pseudo, score);
                    this.addPlayer(play);
                } catch (IOException ex) {
View Full Code Here

            int[] codes = new int[totalEntries];
            unpack(codesBis, bitwidth, codes, totalEntries);
            int exceptions = dis.readShort();
            CharArrayList exceptionList = new CharArrayList(exceptions);
            for(int i = 0; i < exceptions; i++) {
                char c = dis.readChar();
                exceptionList.add(c);
            }
            return new CompressedSegment(totalEntries, bitwidth, firstException, codes, exceptionList);
        }
View Full Code Here

    {
        //indexLength is a multiple of 1024 >> INDEX_STAGE_2_SHIFT_
        m_index_              = new char[m_dataOffset_];
        DataInputStream input = new DataInputStream(inputStream);
        for (int i = 0; i < m_dataOffset_; i ++) {
             m_index_[i] = input.readChar();
        }
    }

    /**
    * Determines if this is a 32 bit trie
View Full Code Here

    {
        DataInputStream input = new DataInputStream(inputStream);
        int indexDataLength = m_dataOffset_ + m_dataLength_;
        m_index_ = new char[indexDataLength];
        for (int i = 0; i < indexDataLength; i ++) {
            m_index_[i] = input.readChar();
        }
        m_data_           = m_index_;
        m_initialValue_   = m_data_[m_dataOffset_];
    }
View Full Code Here

                                        byte dataFormatIDExpected[],
                                        Authenticate authenticate)
                                                          throws IOException
    {
        DataInputStream input = new DataInputStream(inputStream);
        char headersize = input.readChar();
        int readcount = 2;
        //reading the header format
        byte magic1 = input.readByte();
        readcount ++;
        byte magic2 = input.readByte();
View Full Code Here

        readcount ++;
        if (magic1 != MAGIC1 || magic2 != MAGIC2) {
            throw new IOException(MAGIC_NUMBER_AUTHENTICATION_FAILED_);
        }

        input.readChar(); // reading size
        readcount += 2;
        input.readChar(); // reading reserved word
        readcount += 2;
        byte bigendian    = input.readByte();
        readcount ++;
View Full Code Here

            throw new IOException(MAGIC_NUMBER_AUTHENTICATION_FAILED_);
        }

        input.readChar(); // reading size
        readcount += 2;
        input.readChar(); // reading reserved word
        readcount += 2;
        byte bigendian    = input.readByte();
        readcount ++;
        byte charset      = input.readByte();
        readcount ++;
View Full Code Here

      throw ioe;
    } finally {
      // receive the last byte that indicates the proxy released its thread resource
      if (opStatus == DataTransferProtocol.OP_STATUS_SUCCESS) {
        try {
          proxyReply.readChar();
        } catch (IOException ignored) {
        }
      }
     
      // now release the thread resource
View Full Code Here

      throw ioe;
    } finally {
      // receive the last byte that indicates the proxy released its thread resource
      if (opStatus == SUCCESS) {
        try {
          proxyReply.readChar();
        } catch (IOException ignored) {
        }
      }
     
      // now release the thread resource
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.