Package java.io

Examples of java.io.DataInputStream.readInt()


   
    public CallSession restoreSession(FileInputStream fis) throws Exception
    {
      DataInputStream in = new DataInputStream(fis);
      String id = in.readUTF();
      int nbAppSessions = in.readInt();
     
      for (int i = 0; i < nbAppSessions; i++)
      {
        String appId = in.readUTF();
        System.out.println("read call: " + id + " / " + appId);
View Full Code Here


            StringBuffer sb = new StringBuffer(32);
            byte[] vmid_bytes = baos.toByteArray();
            dis = new DataInputStream(new ByteArrayInputStream( vmid_bytes ) );
            for (int i = 0, num_ints = vmid_bytes.length / 4; i < num_ints; ++i)
            {
                int signed = dis.readInt();
                long unsigned = ((long) signed) & 0x00000000FFFFFFFFL;
                sb.append(Long.toString(unsigned, Character.MAX_RADIX));
            }
            return sb.toString();
        }
View Full Code Here

      Hashtable timeStamps = new Hashtable();
      File timestampsFile = getTimeStampsFile();
      DataInputStream in = null;
      try {
        in = new DataInputStream(new BufferedInputStream(new FileInputStream(timestampsFile)));
        int size = in.readInt();
        while (size-- > 0) {
          String key = in.readUTF();
          long timestamp = in.readLong();
          timeStamps.put(Path.fromPortableString(key), new Long(timestamp));
        }
View Full Code Here

//@          System.out.println("currentSettings,data.length=" + currentSettings + "," + ((data == null) ? "null" : Integer.toString(data.length)));
          //#endif
          if( data != null ) {
            bin = new ByteArrayInputStream( data );
            din = new DataInputStream( bin );
            int num = din.readInt();
            while( num-- > 0 ) {
              String name = din.readUTF();
              //#ifdef DLOGGING
//@              if (finestLoggable) {logger.finest("name=" + name);}
              //#endif
View Full Code Here

              //#ifdef DLOGGING
//@              if (finestLoggable) {logger.finest("name=" + name);}
              //#endif
              String value;
              if (currentSettings) {
                final int blen = din.readInt();
                byte [] bvalue = new byte[blen];
                final int alen = din.read(bvalue);
                if (alen <= 0) {
                  value = "";
                } else {
View Full Code Here

        DataInputStream in = null;
        try {
            String fileName;
            in = new DataInputStream(request.getInputStream());
            // 0) an int, the version of this datastream format - REMOTE_DEPLOY_REQUEST_VER
            int reqVer = in.readInt();
            // whenever we update the stream version, the next line needs to
            // be changed to just - (reqVer >= REMOTE_DEPLOY_REQUEST_VER_0)
            // but until then, be more restrictive so we can handle old deployers
            // that don't send a version as the first thing, but a file count instead...
            if ((reqVer >= REMOTE_DEPLOY_REQUEST_VER_0) && (reqVer <= REMOTE_DEPLOY_REQUEST_VER)) {
View Full Code Here

            // be changed to just - (reqVer >= REMOTE_DEPLOY_REQUEST_VER_0)
            // but until then, be more restrictive so we can handle old deployers
            // that don't send a version as the first thing, but a file count instead...
            if ((reqVer >= REMOTE_DEPLOY_REQUEST_VER_0) && (reqVer <= REMOTE_DEPLOY_REQUEST_VER)) {
                // 1) an int, the number of files being uploaded
                fileCount = in.readInt();
                names = new String[fileCount];
                // 2) for each file:
                for(int i=0; i<fileCount; i++) {
                    // 2.0) a UTF String, the filename of the file being uploaded
                    fileName = in.readUTF();
View Full Code Here

          });
          if (d.get("content3") != null) continue;
          count++;
          // read the size from the binary value using DataInputStream (this prevents us from doing the shift ops ourselves):
          final DataInputStream ds = new DataInputStream(new ByteArrayInputStream(d.getFieldable("compressed").getBinaryValue()));
          final int actualSize = ds.readInt();
          ds.close();
          final int compressedSize = Integer.parseInt(d.get("compressedSize"));
          final boolean binary = Integer.parseInt(d.get("id")) % 2 > 0;
          final int shouldSize = shouldStillBeCompressed ?
            compressedSize :
View Full Code Here

    trans.flush();
    assertEquals(2, countingTrans.writeCount);

    DataInputStream din = new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));
    assertEquals(256, din.readInt());

    byte[] buf = new byte[256];
    din.read(buf, 0, 256);
    assertTrue(Arrays.equals(byteSequence(0,255), buf));
  }
View Full Code Here

      {

        bais = new ByteArrayInputStream(barray);
        dais = new DataInputStream(bais);

        if (dais.readInt() != fid)
              {
                  throw StandardException.newException(
                          SQLState.LOG_INCOMPATIBLE_FORMAT, dataDirectory);
              }
 
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.