Package java.io

Examples of java.io.DataInputStream.readChar()


            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


      this.getStringHeap().stringHeap = new char[stringheapsz];
      for (int i = 0; i < stringheapsz; i++) {
        if (swap) {
          this.getStringHeap().stringHeap[i] = swap2(dis, bytebuf);
        } else {
          this.getStringHeap().stringHeap[i] = dis.readChar();
        }
      }
      this.getStringHeap().charHeapPos = stringheapsz;

      // word alignment
View Full Code Here

      }
      this.getStringHeap().charHeapPos = stringheapsz;

      // word alignment
      if (stringheapsz % 2 != 0) {
        dis.readChar();
      }

      // string ref heap
      int refheapsz = 0;
      if (swap) {
View Full Code Here

     */
    static SSpaceFormat getFormat(File sspaceFile) throws IOException {
        DataInputStream dis = new DataInputStream(
            new BufferedInputStream(new FileInputStream(sspaceFile)));
        // read the expected header
        char header = dis.readChar();
        if (header != 's') {
            dis.close();
            return SSpaceFormat.SERIALIZE;
        }
        char encodedFormatCode = dis.readChar();
View Full Code Here

        char header = dis.readChar();
        if (header != 's') {
            dis.close();
            return SSpaceFormat.SERIALIZE;
        }
        char encodedFormatCode = dis.readChar();
        int formatCode = encodedFormatCode - '0';
        dis.close();
        return (formatCode < 0 || formatCode > SSpaceFormat.values().length)
            ? SSpaceFormat.SERIALIZE
            : SSpaceFormat.values()[formatCode];               
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

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.