Examples of available()


Examples of org.apache.poi.poifs.storage.DataInputBlock.available()

  void read(byte[] buffer, int offset) {
    int len = buffer.length;

    DataInputBlock currentBlock = getDataInputBlock(offset);
   
    int blockAvailable = currentBlock.available();
    if (blockAvailable > len) {
      currentBlock.readFully(buffer, 0, len);
      return;
    }
    // else read big amount in chunks
View Full Code Here

Examples of org.apache.poi.util.LittleEndianInput.available()

      } else {
        field_12_name_text = StringUtil.readCompressedUnicode(in, field_3_length_name_text);
      }
    }

    int nBytesAvailable = in.available() - (f7_customMenuLen
        + f8_descriptionTextLen + f9_helpTopicTextLen + f10_statusBarTextLen);
    field_13_name_definition = Formula.read(field_4_length_name_definition, in, nBytesAvailable);

    //Who says that this can only ever be compressed unicode???
    field_14_custom_menu_text = StringUtil.readCompressedUnicode(in, f7_customMenuLen);
View Full Code Here

Examples of org.apache.sshd.common.util.Buffer.available()

            buf.putByte((byte) 1);
            buf.putString(keyAlg);
            buffer.rpos(oldPos);
            buffer.wpos(oldPos + 4 + len);
            buf.putBuffer(buffer);
            verif.update(buf.array(), buf.rpos(), buf.available());
            if (!verif.verify(sig)) {
                throw new Exception("Key verification failed");
            }
            return true;
        }
View Full Code Here

Examples of org.apache.tomcat.lite.io.IOBuffer.available()

            if (http10) {
                if (cl < 0 && !sendBodyState.noBody &&
                        sendBody.isAppendClosed()) {
                    // We can generate content-lenght
                    cl = sendBody.available();
                    res.setContentLength(cl);
                }
                if (cl < 0 && !sendBodyState.noBody) {
                    closeStreamOnEnd("HTTP/1.0 without content length");
                } else {
View Full Code Here

Examples of org.apache.tomcat.util.bcel.util.ByteSequence.available()

        ByteSequence stream = new ByteSequence(code);
        try {
            for (int i = 0; i < index; i++) {
                codeToString(stream, constant_pool, verbose);
            }
            for (int i = 0; stream.available() > 0; i++) {
                if ((length < 0) || (i < length)) {
                    String indices = fillup(stream.getIndex() + ":", 6, true, ' ');
                    buf.append(indices).append(codeToString(stream, constant_pool, verbose))
                            .append('\n');
                }
View Full Code Here

Examples of org.apache.tools.tar.TarInputStream.available()

        File tmp = null;
       
        // loop through the elements in the tar file and parse every single file inside
        while (true) {
            try {
                if (tis.available() <= 0) break;
                entry = tis.getNextEntry();
                if (entry == null) break;
                if (entry.isDirectory() || entry.getSize() <= 0) continue;
                final String name = entry.getName();
                final int idx = name.lastIndexOf('.');
View Full Code Here

Examples of org.apache.xindice.util.ByteArrayInput.available()

         content.startElement(nsURI !=null ? nsURI : "", localName, elemName, attrs);
      }
      else
         in.readInt();

      while ( !interrupt && bis.available() > 0 ) {
         pos = bis.getPos();
         /* TODO why is it used for? byte signature = */ in.readSignature();
         len = in.readContentSize();
         if ( len == 0 )
            len = 1;
View Full Code Here

Examples of org.apache.xindice.xml.XMLCompressedInput.available()

            }
        } else {
            in.readInt();
        }

        while (in.available() > 0) {
            int pos = bis.getPos();
            in.readSignature();             // Skip signature
            int len = in.readContentSize();
            if (len == 0) {
                len = 1;
View Full Code Here

Examples of org.archive.io.arc.ARCRecord.available()

      arcRecord.skipHttpHeader();
      if (arcRecord.hasErrors()) {
        logger.warning("record has errors: " + arcRecord.getErrors());
      }
      byte[] buffer = new byte[BUFFER_SIZE];
      if (arcRecord.available() > 0) {
        // for (int r = -1; (r = arcRecord.read(buffer, 0, BUFFER_SIZE)) != -1;) {
        int r = -1;
        while((r = arcRecord.read(buffer, 0, BUFFER_SIZE)) != -1) {
          // os.write(buffer, 0, r);
          System.out.write(buffer, 0, r);
View Full Code Here

Examples of org.archive.io.warc.WARCRecord.available()

   */
  private void replayRecord(WARCReader warcReader) throws IOException {
    warcReader.setStrict(true);
    WARCRecord warcRecord = (WARCRecord) warcReader.get(this.offset);
      byte[] buffer = new byte[BUFFER_SIZE];
      if (warcRecord.available() > 0) {
        int r = -1;
        while((r = warcRecord.read(buffer, 0, BUFFER_SIZE)) != -1) {
          System.out.write(buffer, 0, r);
        }
      }
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.