Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.DataOutputBuffer.writeInt()


                default:
                    throw new IOException("Incompatible lzop algorithm " + getAlgorithm());
            }
            long mask = LzopConstants.F_ADLER32_C | LzopConstants.F_ADLER32_D;
            mask = mask | LzopConstants.F_CRC32_C | LzopConstants.F_CRC32_D;
            dob.writeInt((int) (flags & mask & 0xFFFFFFFF)); // all flags 0
            dob.writeInt(33188); // mode
            dob.writeInt((int) (System.currentTimeMillis() / 1000)); // mtime
            dob.writeInt(0); // gmtdiff ignored
            dob.writeByte(0); // no filename
            Adler32 headerChecksum = new Adler32();
View Full Code Here


                    throw new IOException("Incompatible lzop algorithm " + getAlgorithm());
            }
            long mask = LzopConstants.F_ADLER32_C | LzopConstants.F_ADLER32_D;
            mask = mask | LzopConstants.F_CRC32_C | LzopConstants.F_CRC32_D;
            dob.writeInt((int) (flags & mask & 0xFFFFFFFF)); // all flags 0
            dob.writeInt(33188); // mode
            dob.writeInt((int) (System.currentTimeMillis() / 1000)); // mtime
            dob.writeInt(0); // gmtdiff ignored
            dob.writeByte(0); // no filename
            Adler32 headerChecksum = new Adler32();
            headerChecksum.update(dob.getData(), 0, dob.getLength());
View Full Code Here

            }
            long mask = LzopConstants.F_ADLER32_C | LzopConstants.F_ADLER32_D;
            mask = mask | LzopConstants.F_CRC32_C | LzopConstants.F_CRC32_D;
            dob.writeInt((int) (flags & mask & 0xFFFFFFFF)); // all flags 0
            dob.writeInt(33188); // mode
            dob.writeInt((int) (System.currentTimeMillis() / 1000)); // mtime
            dob.writeInt(0); // gmtdiff ignored
            dob.writeByte(0); // no filename
            Adler32 headerChecksum = new Adler32();
            headerChecksum.update(dob.getData(), 0, dob.getLength());
            int hc = (int) headerChecksum.getValue();
View Full Code Here

            long mask = LzopConstants.F_ADLER32_C | LzopConstants.F_ADLER32_D;
            mask = mask | LzopConstants.F_CRC32_C | LzopConstants.F_CRC32_D;
            dob.writeInt((int) (flags & mask & 0xFFFFFFFF)); // all flags 0
            dob.writeInt(33188); // mode
            dob.writeInt((int) (System.currentTimeMillis() / 1000)); // mtime
            dob.writeInt(0); // gmtdiff ignored
            dob.writeByte(0); // no filename
            Adler32 headerChecksum = new Adler32();
            headerChecksum.update(dob.getData(), 0, dob.getLength());
            int hc = (int) headerChecksum.getValue();
            dob.writeInt(hc);
View Full Code Here

            dob.writeInt(0); // gmtdiff ignored
            dob.writeByte(0); // no filename
            Adler32 headerChecksum = new Adler32();
            headerChecksum.update(dob.getData(), 0, dob.getLength());
            int hc = (int) headerChecksum.getValue();
            dob.writeInt(hc);
            out.write(LzopConstants.LZOP_MAGIC);
            out.write(dob.getData(), 0, dob.getLength());
        } finally {
            dob.close();
        }
View Full Code Here

      if (LOG.isDebugEnabled())
        LOG.debug(this.getClass().getName() + " sending #" + sendCall.id);
      DataOutputBuffer buff = null;
      try {
        buff = new DataOutputBuffer();
        buff.writeInt(sendCall.id);
        sendCall.param.write(buff);
        byte[] data = buff.getData();
        int dataLength = buff.getLength();
        ByteBuf buf = channel.alloc().buffer();
View Full Code Here

      final DataOutputBuffer d = new DataOutputBuffer();
      try {
        if (LOG.isDebugEnabled())
          LOG.debug(getName() + " sending #" + call.id);

        d.writeInt(0xdeadbeef); // placeholder for data length
        d.writeInt(call.id);
        call.param.write(d);
        byte[] data = d.getData();
        int dataLength = d.getLength();
        // fill in the placeholder
View Full Code Here

      try {
        if (LOG.isDebugEnabled())
          LOG.debug(getName() + " sending #" + call.id);

        d.writeInt(0xdeadbeef); // placeholder for data length
        d.writeInt(call.id);
        call.param.write(d);
        byte[] data = d.getData();
        int dataLength = d.getLength();
        // fill in the placeholder
        Bytes.putInt(data, 0, dataLength - 4);
View Full Code Here

            LOG.debug(getName() + " sending #" + call.id);
         
          //for serializing the
          //data to be written
          d = new DataOutputBuffer();
          d.writeInt(0); // placeholder for data length
          d.writeInt(call.id);
          call.param.write(d);
          byte[] data = d.getData();
          int dataLength = d.getLength() - 4;
          data[0] = (byte)((dataLength >>> 24) & 0xff);
View Full Code Here

         
          //for serializing the
          //data to be written
          d = new DataOutputBuffer();
          d.writeInt(0); // placeholder for data length
          d.writeInt(call.id);
          call.param.write(d);
          byte[] data = d.getData();
          int dataLength = d.getLength() - 4;
          data[0] = (byte)((dataLength >>> 24) & 0xff);
          data[1] = (byte)((dataLength >>> 16) & 0xff);
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.