Package java.nio

Examples of java.nio.MappedByteBuffer.position()


        if (eh.e_shnum <= 0) {
            log.log(Level.FINE, "Skipping file, no section headers");
            return;
        }

        fmap.position(eh.e_shoff + (eh.e_shstrndx * eh.e_shentsize));
        ELFSection stringSection = new ELFSection(fmap);

        if (stringSection.sh_size == 0) {
            log.log(Level.FINE, "Skipping file, no section name string table");
            return;
View Full Code Here


        ELFSection[] sections = new ELFSection[eh.e_shnum];
        int[] readables = new int[eh.e_shnum];

        int ri = 0;
        for (int i = 0; i < eh.e_shnum; i++) {
            fmap.position(eh.e_shoff + (i * eh.e_shentsize));

            sections[i] = new ELFSection(fmap);
            String sectionName = getName(stringSection.sh_offset, sections[i].sh_name, fmap);
            if (sectionName != null) {
                sectionMap.put(sectionName, sections[i].sh_offset);
View Full Code Here

        }

        boolean lastPrintable = false;
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < ri; i++) {
            fmap.position(sections[readables[i]].sh_offset);
            int size = sections[readables[i]].sh_size;
            byte c;
            while (size-- > 0) {
                c = fmap.get();
                if (isReadable(c)) {
View Full Code Here

  MappedByteBuffer mb = mbs[chunk];
  long readEnd        = (((long)chunk_n) + ((long)size));
  int  readSize       = (int)((readEnd <= MAP_SIZE) ? size : (MAP_SIZE - chunk_n));

  synchronized(mb) {
      mb.position(chunk_n);
      mb.get(buffer, 0, readSize);
  }

  if(readEnd > MAP_SIZE) {
      mb = mbs[++chunk];
View Full Code Here

  }

  if(readEnd > MAP_SIZE) {
      mb = mbs[++chunk];
      synchronized(mb) {
    mb.position(0);
    mb.get(buffer, readSize, (int)(readEnd - MAP_SIZE));
      }
  }
    }
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.