Package java.io

Examples of java.io.DataInput.readLong()


    }
   
    public void readNext() throws IOException, DataFormatException {
      entryIndex++;
      DataInput di = dis;
      long l = di.readLong();
      offset = entryIndex == 0 ? 0 : (l >>> 16);
      flags = (int) (l & 0x0FFFF);
      compressedLen = di.readInt();
      actualLen = di.readInt();
      baseRevision = di.readInt();
View Full Code Here


                final CRC32 crc32 = new CRC32();
                final DataOutput output = new DataOutputStream(new CheckedOutputStream(socket.getOutputStream(), crc32));
                final DataInput input = new DataInputStream(socket.getInputStream());
                output.writeByte(INIT);
                long logId = input.readLong();
                do {
                    final long nextLogId = logId + 1;
                    final File file = Util.logFile(nextLogId);
                    if (file.exists() && server.getLogger().isWritten(nextLogId)) {
                        logId++;
View Full Code Here

            do {
                if (input.readByte() != RECOVERY_LOG) {
                    return;
                }
                crc32.reset();
                final long logId = input.readLong();
                final File file = Util.tmpLogFile(logId);
                LOG.info("syncing recovery file: " + file.getName());
                final BufferedOutputStream fileOutput = new BufferedOutputStream(new FileOutputStream(file));

                final byte[] buffer = new byte[8092];
View Full Code Here

                    fileOutput.write(buffer, 0, length);
                }
                fileOutput.close();

                final long calculatedChecksum = crc32.getValue();
                final long sentChecksum = input.readLong();
                if (calculatedChecksum != sentChecksum) {
                    throw new NoSqlStoreException("Checksum didn't match during download of " + file.getName());
                }

                recover(file);
View Full Code Here

                final CRC32 crc32 = new CRC32();
                final DataOutput output = new DataOutputStream(new CheckedOutputStream(socket.getOutputStream(), crc32));
                final DataInput input = new DataInputStream(socket.getInputStream());
                output.writeByte(INIT);
                long logId = input.readLong();
                do {
                    final long nextLogId = logId + 1;
                    final File file = Util.logFile(nextLogId);
                    if (file.exists() && server.getLogger().isWritten(nextLogId)) {
                        logId++;
View Full Code Here

            do {
                if (input.readByte() != RECOVERY_LOG) {
                    return;
                }
                crc32.reset();
                final long logId = input.readLong();
                final File file = Util.tmpLogFile(logId);
                LOG.info("syncing recovery file: " + file.getName());
                final BufferedOutputStream fileOutput = new BufferedOutputStream(new FileOutputStream(file));

                final byte[] buffer = new byte[8092];
View Full Code Here

                    fileOutput.write(buffer, 0, length);
                }
                fileOutput.close();

                final long calculatedChecksum = crc32.getValue();
                final long sentChecksum = input.readLong();
                if (calculatedChecksum != sentChecksum) {
                    throw new NoSqlStoreException("Checksum didn't match during download of " + file.getName());
                }

                recover(file);
View Full Code Here

                CRC32 crc32 = new CRC32();
                DataOutput output = new DataOutputStream(new CheckedOutputStream(socket.getOutputStream(), crc32));
                DataInput input = new DataInputStream(socket.getInputStream());
                output.writeByte(INIT);
                long logId = input.readLong();
                do {
                    long nextLogId = logId + 1;
                    File file = Util.logFile(nextLogId);
                    if (file.exists() && server.getLogger().isWritten(nextLogId)) {
                        logId++;
View Full Code Here

            do {
                if (input.readByte() != RECOVERY_LOG) {
                    return;
                }
                crc32.reset();
                long logId = input.readLong();
                File file = Util.tmpLogFile(logId);
                LOG.info("syncing recovery file: " + file.getName());
                BufferedOutputStream fileOutput = new BufferedOutputStream(new FileOutputStream(file));

                byte[] buffer = new byte[8092];
View Full Code Here

                    fileOutput.write(buffer, 0, length);
                }
                fileOutput.close();

                long calculatedChecksum = crc32.getValue();
                long sentChecksum = input.readLong();
                if (calculatedChecksum != sentChecksum) {
                    throw new NoSqlStoreException("Checksum didn't match during download of " + file.getName());
                }

                recover(file);
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.