Examples of available()


Examples of com.google.jstestdriver.token.BufferedTokenStream.available()

                                      + tokens[3].toString()).getBytes()));
    BufferedTokenStream lexer = new HtmlDocLexer().createStream(stream);
    for (Token token : expected) {
      assertEquals(token, lexer.read());
    }
    assertFalse(lexer.available());
  }

  public void testCreateTokensWithOtherTokens() throws Exception {
    Token otherOne = new ConcreteToken("<div></div>".toCharArray());
    BufferedInputStream stream =
View Full Code Here

Examples of com.peterhi.io.PmInputStream.available()

   
    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    PmInputStream pis = new PmInputStream(bais);
    Primitives p1 = pis.readModel();
   
    Assert.assertEquals(0, pis.available());
    pos.close();
    pis.close();
   
    Assert.assertEquals(p0.isBooleanValue(), p1.isBooleanValue());
    Assert.assertEquals(p0.getByteValue(), p1.getByteValue());
View Full Code Here

Examples of com.peterhi.obsolete.Stream.available()

     
      for (int i = 0; i < 4; i++) {
        assertEquals(sampleBytes()[i], sample[i]);
      }

      assertEquals(sampleBytes().length - 4, stream.available());
    } finally {
    }
   
    try {
      Stream stream = new Stream();
View Full Code Here

Examples of com.peterhi.runtime.BitStream.available()

    }
   
    {
      byte[] data = new byte[32];
      BitStream bs = new BitStream(data, Byte.SIZE * 16, Byte.SIZE * 16);
      assertEquals(Byte.SIZE * 16, bs.available());
      assertEquals(16, bs.bytes());
    }
   
    {
      BitStream bs = new BitStream(1);
View Full Code Here

Examples of com.sleepycat.bdb.bind.tuple.TupleInput.available()

        Object result = binding.dataToObject(buffer);
        assertTrue(result instanceof TupleInput);
        TupleInput in = (TupleInput) result;
        assertEquals("abc", in.readString());
        assertEquals(0, in.available());
    }

    // also tests TupleBinding since TupleMarshalledBinding extends it
    public void testTupleMarshalledBinding()
        throws IOException {
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleInput.available()

   private Fqn makeKeyObject(DatabaseEntry entry)
   {

      Fqn name = Fqn.ROOT;
      TupleInput tupleInput = TupleBinding.entryToInput(entry);
      while (tupleInput.available() > 0)
      {
         String part = tupleInput.readString();
         name = Fqn.fromRelativeElements(name, part);
      }
      return name;
View Full Code Here

Examples of com.sshtools.j2ssh.io.ByteArrayReader.available()

     */
    public void fromByteArray(byte[] data) throws InvalidMessageException {
        try {
            ByteArrayReader bar = new ByteArrayReader(data);

            if (bar.available() > 0) {
                type = bar.read();
                constructMessage(bar);
            } else {
                throw new InvalidMessageException(
                    "Not enough message data to complete the message");
View Full Code Here

Examples of com.sun.mail.util.BASE64DecoderStream.available()

            Constructor t2Mconstructor =
                    t2MClass.getConstructor(new Class[]{Class.forName("[B")});
            try {
                BASE64DecoderStream in = new BASE64DecoderStream(
                        new ByteArrayInputStream(challenge.getBytes()));
                byte[] bytes = new byte[in.available()];
                in.read(bytes);
                t2m = t2Mconstructor.newInstance(new Object[]{bytes});
            } catch (IOException ex) {
                IOException ioex = new IOException("Invalid Type2 message");
    ioex.initCause(ex);
View Full Code Here

Examples of com.sun.org.apache.bcel.internal.util.ByteSequence.available()

    /* Pass 1: Create an object for each byte code and append them
     * to the list.
     */
    try {
      while(bytes.available() > 0) {
  // Remember byte offset and associate it with the instruction
  int off =  bytes.getIndex();
  pos[count] = off;
 
  /* Read one instruction from the byte stream, the byte position is set
View Full Code Here

Examples of com.sun.star.io.XInputStream.available()

            int sz = m_xSimpleFileAccess.getSize(path);
            // TODO don't depend on result of available() or size()
            // just read stream 'till complete
            if ( sz == 0 )
            {
                if ( xInputStream.available() > 0 )
                {
                    sz = xInputStream.available();
                }
            }
            LogUtils.DEBUG("size of file " + path  + " is " + sz );
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.