Examples of available()


Examples of de.fub.bytecode.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, i.e.,
View Full Code Here

Examples of er.attachment.model.ERAttachment.available()

  public String viewerClassName() {
    String viewerClassName = null;

    ERAttachment attachment = attachment();
    if (attachment != null) {
      if (attachment.available().booleanValue()) {
        ERMimeType mimeType = attachment.erMimeType();
        if (mimeType != null) {
          viewerClassName = ERXProperties.stringForKey("er.attachment.mimeType." +  mimeType.mimeType() +".viewer");
          if (viewerClassName == null) {
            viewerClassName = ERXProperties.stringForKey("er.attachment.mimeType." +  mimeType.globMimeType().mimeType() +".viewer");
View Full Code Here

Examples of htsjdk.samtools.util.BlockCompressedInputStream.available()

                    boolean lastByteNewline = true;

                    while (in.available() > 0) {
                        // Read a block - blockIn.available() is guaranteed to return the bytes remaining in the block that has been
                        // read, and since we haven't consumed any yet, that is the block size.
                        final int blockLength = blockIn.available();
                        final byte[] blockContents = new byte[blockLength];
                        final int read = blockIn.read(blockContents);
                        if (blockLength == 0 || read != blockLength) throw new IllegalStateException("Could not read available bytes from BlockCompressedInputStream.");

                        // Scan forward within the block to see if we can find the end of the header within this block
View Full Code Here

Examples of io.netty.buffer.ByteBufInputStream.available()

    // the Math.min with the end of the buffer should fix it but now I'm not getting results back, leaving it here for now
    // because it is needed, but there might be a problem with it
    ByteBufInputStream f = new ByteBufInputStream(parentColumnReader.parentReader.getBufferWithAllData().slice(
        (int) parentColumnReader.readPositionInBuffer,
        Math.min(200, parentColumnReader.parentReader.getBufferWithAllData().capacity() - (int) parentColumnReader.readPositionInBuffer)));
    int before = f.available();
    PageHeader pageHeader = readPageHeader(f);
    int length = before - f.available();
    f = new ByteBufInputStream(parentColumnReader.parentReader.getBufferWithAllData().slice(
        (int) parentColumnReader.readPositionInBuffer + length, pageHeader.getCompressed_page_size()));
View Full Code Here

Examples of java.io.BufferedInputStream.available()

   {
      File file = new File(ClassLoader.getSystemResource("normal.html").getFile());
      assertEquals(true, file.exists());
      FileInputStream input = new FileInputStream(file);
      BufferedInputStream buffer = new BufferedInputStream(input);
      byte[] data = new byte[buffer.available()];
      int available = -1;

      Detector det = new Detector(PSMDetector.ALL);

      //Set an observer...
View Full Code Here

Examples of java.io.BufferedOutputStream.available()

            try
            {
                // read the key, and decode from hex encoding
                BufferedInputStream keystream =
                    new BufferedInputStream(new FileInputStream(keyfile));
                int len = keystream.available();
                byte[] keyhex = new byte[len];
                keystream.read(keyhex, 0, len);
                key = Hex.decode(keyhex);
            }
            catch (IOException ioe)
View Full Code Here

Examples of java.io.ByteArrayInputStream.available()

         int length = ObjectOutputStreamMicro.writeMessage(baos, oid, key, qos, content);
         assertEquals("wrong length returned", oid.length() + key.length() + qos.length() + content.length + 3, length);
         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         ObjectInputStreamMicro oism = new ObjectInputStreamMicro(bais);

         int size = bais.available();
         assertEquals("wrong length of bytes available", length, size);
         byte[] msg = new byte[size];
         bais.read(msg);
         MsgHolder msgHolder = ObjectInputStreamMicro.readMessage(msg);
        
View Full Code Here

Examples of java.io.DataInputStream.available()

                int len = in.readInt();
                byte[] tuple = new byte[len];
                in.read(tuple);
                tuples.add(tuple);
            }
            if(in.available() > 0) {
                throw new IllegalStateException(in.available() + " bytes left");
            }
            this.totalDataLen = v.getLength();
            this.loaded = true;
        }
View Full Code Here

Examples of java.io.FileInputStream.available()

        FileOutputStream fos=null;
       
        try {
          fis=new FileInputStream(f);
         
          byte[] b=new byte[fis.available()];
          fis.read(b);
         
          String str=new String(b);
         
          fis.close();
View Full Code Here

Examples of java.io.InputStream.available()

        String s;
        ResourceDownloaderFactory rdf = ResourceDownloaderFactoryImpl.getSingleton();
        try {
          ResourceDownloader rd = rdf.create(new URL(url));
          InputStream is = rd.download();
          int length = is.available();
          byte data[] = new byte[length];
          is.read(data);
          is.close();
          s = new String(data);
        } catch (ResourceDownloaderException rde) {
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.