Examples of reset()


Examples of org.apache.hadoop.io.InputBuffer.reset()

     */
    @Test
    public void readByte_random() throws Exception {
        byte[] bytes = "ABC|D|EF".getBytes(Charset.forName("ASCII"));
        InputBuffer buffer = new InputBuffer();
        buffer.reset(bytes, bytes.length);
        Random random = new Random(12345);
        for (int i = 0; i < 100000; i++) {
            int[] bounds = new int[5];
            for (int j = 0; j < bounds.length; j++) {
                bounds[j] = random.nextInt(bytes.length + 1);
View Full Code Here

Examples of org.apache.hadoop.io.compress.Decompressor.reset()

      in = checksumIn;
      Decompressor decompressor = null;
      if (isCompressed && codec != null) {
        decompressor = CodecPool.getDecompressor(codec);
        if (decompressor != null) {
          decompressor.reset();
          in = codec.createInputStream(checksumIn, decompressor);
        } else {
          LOG.warn("Could not obtain decompressor from CodecPool");
          in = checksumIn;
        }
View Full Code Here

Examples of org.apache.hadoop.io.compress.lz4.Lz4Compressor.reset()

      byte[] decompressed = new byte[BYTE_SIZE];
      decompressor.decompress(decompressed, 0, decompressed.length);

      assertTrue("testLz4CompressDecompress finished error !!!", decompressor.finished());     
      assertArrayEquals(bytes, decompressed);
      compressor.reset();
      decompressor.reset();
      assertTrue("decompressor getRemaining error !!!",decompressor.getRemaining() == 0);
    } catch (Exception e) {
      fail("testLz4CompressDecompress ex error!!!");
    }
View Full Code Here

Examples of org.apache.hadoop.io.compress.lz4.Lz4Decompressor.reset()

      decompressor.decompress(decompressed, 0, decompressed.length);

      assertTrue("testLz4CompressDecompress finished error !!!", decompressor.finished());     
      assertArrayEquals(bytes, decompressed);
      compressor.reset();
      decompressor.reset();
      assertTrue("decompressor getRemaining error !!!",decompressor.getRemaining() == 0);
    } catch (Exception e) {
      fail("testLz4CompressDecompress ex error!!!");
    }
  }
View Full Code Here

Examples of org.apache.hadoop.util.DataChecksum.reset()

                    while ((bytesRead = in.read(buf)) > 0) {

                        lTotalBytesRead += bytesRead;

                        chksm.reset();
                        chksm.update(buf, 0, bytesRead);
                        chksm.writeValue(crc, 0, true);
                        ar_CRC_Bytes.write(crc);

                        if (lTotalBytesRead >= (x + 1) * lBlockSize) {
View Full Code Here

Examples of org.apache.hadoop.util.NativeCrc32.reset()

    throws IOException {
   
    PrintStream ps = out instanceof PrintStream ? (PrintStream)out : null;
    byte buf[] = new byte[buffSize];
    Checksum sum = new NativeCrc32();
    sum.reset();
    try {
      if (throttler != null) {
        throttler.throttle((long) buffSize);
      }
      int bytesRead = in.read(buf);
View Full Code Here

Examples of org.apache.hadoop.util.PureJavaCrc32.reset()

    }
    indexFile.createNewFile();
    FSDataOutputStream output = FileSystem.getLocal(conf).getRaw().append(
        new Path(indexFile.getAbsolutePath()));
    Checksum crc = new PureJavaCrc32();
    crc.reset();
    CheckedOutputStream chk = new CheckedOutputStream(output, crc);
    String msg = "Writing new index file. This file will be used only " +
        "for the testing.";
    chk.write(Arrays.copyOf(msg.getBytes(),
        MapTask.MAP_OUTPUT_INDEX_RECORD_LENGTH));
View Full Code Here

Examples of org.apache.harmony.auth.tests.support.SecurityChecker.reset()

    Configuration custom = new ConfTestProvider();
    Configuration.setConfiguration(custom);
    assertTrue(checker.checkAsserted);
    assertSame(custom, Configuration.getConfiguration());

    checker.reset();
    checker.enableAccess = false;
    try {
      Configuration.setConfiguration(new ConfTestProvider());
      fail("No expected SecurityException");
    } catch (SecurityException ex) {
View Full Code Here

Examples of org.apache.harmony.security.tests.support.MyMessageDigest1.reset()

    /**
     * @tests java.security.MessageDigest#reset()
     */
    public void test_reset() {
        MyMessageDigest1 md = new MyMessageDigest1("ABC");
        md.reset();
        assertTrue(md.runEngineReset);
    }

    /**
     * @tests java.security.MessageDigest#update(byte)
View Full Code Here

Examples of org.apache.harmony.security.tests.support.SecurityChecker.reset()

            Policy custom = new TestProvider();
            Policy.setPolicy(custom);
            assertTrue(checker.checkAsserted);
            assertSame(custom, Policy.getPolicy());

            checker.reset();
            checker.enableAccess = false;
            try {
                Policy.setPolicy(new TestProvider());
                fail("SecurityException is intercepted");
            } catch (SecurityException ok) {
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.