Examples of available()


Examples of org.apache.commons.compress.compressors.xz.XZCompressorInputStream.available()

            final CompressorInputStream in =
                new XZCompressorInputStream(is, true);
            try {
                assertEquals('a', in.read());
                assertEquals('b', in.read());
                assertEquals(0, in.available());
                assertEquals(-1, in.read());
            } finally {
                in.close();
            }
        } finally {
View Full Code Here

Examples of org.apache.directory.server.xdbm.search.cursor.NotCursor.available()

        Set<String> set = new HashSet<String>();

        while ( cursor.next() )
        {
            assertTrue( cursor.available() );
            set.add( cursor.get().getId() );
            assertTrue( uuidSynChecker.isValidSyntax( cursor.get().getKey() ) );
        }

        assertEquals( 5, set.size() );
View Full Code Here

Examples of org.apache.directory.server.xdbm.search.cursor.PresenceCursor.available()

        assertEquals( node, evaluator.getExpression() );

        cursor.beforeFirst();
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
        assertTrue( cursor.next() );
View Full Code Here

Examples of org.apache.directory.server.xdbm.search.cursor.SubstringCursor.available()

        assertTrue( cursor.available() );
        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
        assertEquals( "bean", cursor.get().getKey() );

        assertFalse( cursor.previous() );
        assertFalse( cursor.available() );
        cursor.close();
    }


    @Test
View Full Code Here

Examples of org.apache.fop.util.UnclosableInputStream.available()

        FopImage.ImageInfo info = new FopImage.ImageInfo();
        info.mimeType = getMimeType();

        try {
            final InputStream is = new UnclosableInputStream(input);
            int length = is.available();
            is.mark(length);

            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            doc = dbf.newDocumentBuilder().parse(is);
            info.data = doc;
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataInputStream.available()

            "nor Syncable.hflush().");
      }
    }
    syncMethod.invoke(out, new Object[]{});
    FSDataInputStream in = fs.open(p);
    assertTrue(in.available() > 0);
    byte [] buffer = new byte [1024];
    int read = in.read(buffer);
    assertEquals(bytes.length, read);
    out.close();
    in.close();
View Full Code Here

Examples of org.apache.hadoop.hbase.stargate.util.HTableTokenBucket.available()

      HTableTokenBucket tb = (HTableTokenBucket) ud.get(UserData.TOKENBUCKET);
      if (tb == null) {
        tb = new HTableTokenBucket(conf, Bytes.toBytes(user.getToken()));
        ud.put(UserData.TOKENBUCKET, tb);
      }
      if (tb.available() < want) {
        return false;
      }
      tb.remove(want);
    }
    return true;
View Full Code Here

Examples of org.apache.hadoop.hdfs.util.ExactSizeInputStream.available()

public class TestExactSizeInputStream {
  @Test
  public void testBasicsReadSingle() throws IOException {
    ExactSizeInputStream s = new ExactSizeInputStream(byteStream("hello"), 3);
    assertEquals(3, s.available());
   
    assertEquals((int)'h', s.read());
    assertEquals((int)'e', s.read());
    assertEquals((int)'l', s.read());
    assertEquals(-1, s.read());
View Full Code Here

Examples of org.apache.hadoop.io.DataInputBuffer.available()

    }
    DataInputBuffer in = new DataInputBuffer();
    List<HRegionInfo> hris = new ArrayList<HRegionInfo>();
    try {
      in.reset(bytes, offset, length);
      while (in.available() > 0) {
        HRegionInfo hri = parseFrom(in);
        hris.add(hri);
      }
    } finally {
      in.close();
View Full Code Here

Examples of org.apache.hadoop.io.compress.CompressionInputStream.available()

            CompressionInputStream cin = c.createInputStream(bin);

         
            int totaln = 0;

            while (cin.available() > 0)
            {
                int n = cin.read(buffer);
                if (n < 0)
                    break;
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.