Package java.io

Examples of java.io.DataInputStream.readLong()


        case Leader.REVALIDATE:
            type = "REVALIDATE";
            ByteArrayInputStream bis = new ByteArrayInputStream(p.getData());
            DataInputStream dis = new DataInputStream(bis);
            try {
                long id = dis.readLong();
                mess = " sessionid = " + id;
            } catch (IOException e) {
                LOG.warn("Unexpected exception", e);
            }
View Full Code Here


                    // Process the touches
                    ByteArrayInputStream bis = new ByteArrayInputStream(qp
                            .getData());
                    DataInputStream dis = new DataInputStream(bis);
                    while (dis.available() > 0) {
                        long sess = dis.readLong();
                        int to = dis.readInt();
                        leader.zk.touch(sess, to);
                    }
                    break;
                case Leader.REVALIDATE:
View Full Code Here

                    }
                    break;
                case Leader.REVALIDATE:
                    bis = new ByteArrayInputStream(qp.getData());
                    dis = new DataInputStream(bis);
                    long id = dis.readLong();
                    int to = dis.readInt();
                    ByteArrayOutputStream bos = new ByteArrayOutputStream();
                    DataOutputStream dos = new DataOutputStream(bos);
                    dos.writeLong(id);
                    boolean valid = leader.zk.touch(id, to);
View Full Code Here

                        break;
                    case Leader.REVALIDATE:
                        ByteArrayInputStream bis = new ByteArrayInputStream(qp
                                .getData());
                        DataInputStream dis = new DataInputStream(bis);
                        long sessionId = dis.readLong();
                        boolean valid = dis.readBoolean();
                        synchronized (pendingRevalidations) {
                            ServerCnxn cnxn = pendingRevalidations
                                    .remove(sessionId);
                            if (cnxn == null) {
View Full Code Here

         }

         // Read in the pointers
         ptrs = new long[ph.getPointerCount()];
         for ( int i = 0; i < ptrs.length; i++ )
            ptrs[i] = is.readLong();

         cache.put(new Long(page.getPageNum()), this);
      }

      public synchronized void write() throws IOException {
View Full Code Here

                  throw StandardException.newException(
                          SQLState.LOG_INCOMPATIBLE_FORMAT, dataDirectory);
              }
 
        int obsoleteVersion = dais.readInt();
        value = dais.readLong();
 
        if (SanityManager.DEBUG)
        {
          if (SanityManager.DEBUG_ON(LogToFile.DBG_FLAG))
                      SanityManager.DEBUG(LogToFile.DBG_FLAG,
View Full Code Here

    File timeFile = getImageFile(sd, NameNodeFile.TIME);
    long timeStamp = 0L;
    if (timeFile.exists() && timeFile.canRead()) {
      DataInputStream in = new DataInputStream(new FileInputStream(timeFile));
      try {
        timeStamp = in.readLong();
      } finally {
        in.close();
      }
    }
    return timeStamp;
View Full Code Here

       
        //
        // Get bytes in block, set streams
        //
        in = new DataInputStream(new BufferedInputStream(s.getInputStream()));
        long curBlockSize = in.readLong();
        long amtSkipped = in.readLong();
        if (curBlockSize != lblock.getBlock().len) {
          throw new IOException("Recorded block size is " + lblock.getBlock().len + ", but datanode reports size of " + curBlockSize);
        }
        if (amtSkipped != 0L) {
View Full Code Here

        //
        // Get bytes in block, set streams
        //
        in = new DataInputStream(new BufferedInputStream(s.getInputStream()));
        long curBlockSize = in.readLong();
        long amtSkipped = in.readLong();
        if (curBlockSize != lblock.getBlock().len) {
          throw new IOException("Recorded block size is " + lblock.getBlock().len + ", but datanode reports size of " + curBlockSize);
        }
        if (amtSkipped != 0L) {
          throw new IOException("Asked for offset of " + 0L + ", but only received offset of " + amtSkipped);
View Full Code Here

    public PNGFile(InputStream stream) throws IOException, ImageException {
        if (!stream.markSupported()) {
            stream = new BufferedInputStream(stream);
        }
        DataInputStream distream = new DataInputStream(stream);
        long magic = distream.readLong();
        if (magic != PNG_SIGNATURE) {
            String msg = PropertyUtil.getString("PNGImageDecoder0");
            throw new ImageException(msg);
        }
        // only some chunks are worth parsing in the current implementation
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.