Skips ahead a number of characters.

    Args:
      file_object (dfvfs.FileIO): file-like object.
      number_of_characters (int): number of characters.
488411
def SkipAhead(self, file_object, number_of_characters):
    
    lines_size = len(self.lines)
    while number_of_characters >= lines_size:
      number_of_characters -= lines_size

      self.lines = ''
      self.ReadLines(file_object)
      lines_size = len(self.lines)
      if lines_size == 0:
        return

    self.lines = self.lines[number_of_characters:]
518261
boolean skipObject()
    throws IOException
  {
    int ch = read();
    int len;
    
    switch (ch) {
     // inline string (1 byte)
    case 0x00: case 0x01: case 0x02: case 0x03:
    case 0x04: case 0x05: case 0x06: case 0x07:
    case 0x08: case 0x09: case 0x0a: case 0x0b:
    case 0x0c: case 0x0d: case 0x0e: case 0x0f:
      
    case 0x10: case 0x11: case 0x12: case 0x13:
    case 0x14: case 0x15: case 0x16: case 0x17:
    case 0x18: case 0x19: case 0x1a: case 0x1b:
    case 0x1c: case 0x1d: case 0x1e: case 0x1f:
      skip(ch - 0x00);
      return true;
      
      // inline binary (1 byte)
    case 0x20: case 0x21: case 0x22: case 0x23:
    case 0x24: case 0x25: case 0x26: case 0x27:
    case 0x28: case 0x29: case 0x2a: case 0x2b:
    case 0x2c: case 0x2d: case 0x2e: case 0x2f:
      skip(ch - 0x20);
      return true;
      
      // string (1 byte)
    case 0x30: case 0x31: case 0x32: case 0x33:
      len = 256 * (ch - 0x30) + read();
      skip(len);
      return true;
      
      // binary (1 byte)
    case 0x34: case 0x35: case 0x36: case 0x37:
      len = 256 * (ch - 0x34) + read();
      skip(len);
      return true;
      
      // 0x38-0x3b are reserved
      
      // long three-byte
    case 0x3c: case 0x3d: case 0x3e: case 0x3f:
      skip(2);
      return true;
      
      // 0x40 is reserved
      
      // binary non-tail chunk
    case 0x41:
      len = readShort();
      skip(len);
      return skipObject();
      
      // binary tail chunk
    case 0x42:
      len = readShort();
      skip(len);
      return true;
      
      // class def
    case 0x43:
      scanObjectDef();
      return skipObject();
      
      // 64-bit double
    case 0x44:
      skip(8);
      return true;
      
      // error marker
    case 0x45:
      throw new IllegalStateException("Invalid Hessian bytecode 'E'");
      
      // false
    case 0x46:
      return true;
      
      // ext type (fixed int)
    case 0x47:
      skipObject();
      skipObject();
      return true;
      
    case 0x48: { // untyped map 'H'
      skipMap();
      return true;
    }
      
      // 32-bit int
    case 0x49:
      skip(4);
      return true;
      
      // 64-bit date
    case 0x4a:
      skip(8);
      return true;
      
      // 32-bit date
    case 0x4b:
      skip(4);
      return true;
      
      // 64-bit long
    case 0x4c:
      skip(8);
      return true;
      
    case 0x4d: { // typed map 'M'
      skipObject();
      skipMap();
      return true;
    }
      
      // null
    case 0x4e:
      return true;
      
    case 0x4f: // object instance
      {
        int type = scanInt();
        String []def = _classDefs.get(type);
        len = def.length - 1;
        for (int i = 0; i < len; i++) {
          skipObject();
        }
        return true;
      }
      
      // ext type (named)
    case 0x50:
      skipObject();
      skipObject();
      return true;
      
      // backref
    case 0x51:
      skipObject();
      return true;
      
      // string non-tail chunk
    case 0x52:
      len = readShort();
      skip(len);
      return skipObject();
      
      // string tail chunk
    case 0x53:
      len = readShort();
      skip(len);
      return true;
      
      // true
    case 0x54:
      return true;
      
      // typed variable list
    case 0x55:
      readType();
      while (skipObject()) {
      }
      return true;
      
      // typed fixed list
    case 0x56:
      readType();
      len = scanInt();
      for (int i = 0; i < len; i++) {
        skipObject();
      }
      return true;
      
      // untyped variable list
    case 0x57:
      while (skipObject()) {
      }
      return true;
      
      // untyped fixed list
    case 0x58:
      len = scanInt();
      for (int i = 0; i < len; i++) {
        skipObject();
      }
      return true;
      
      // 32-bit long
    case 0x59:
      skip(4);
      return true;
      
    case 0x5a: // 'Z' end
      return false;
      
      // 0.0, 1.0
    case 0x5b: case 0x5c:
      return true;
      
      // (double) b0
    case 0x5d:
      skip(1);
      return true;
      
      // (double) b1 b0
    case 0x5e:
      skip(2);
      return true;
      
      // (double) int
    case 0x5f:
      return skipObject();
      
      // object instance
    case 0x60: case 0x61: case 0x62: case 0x63:
    case 0x64: case 0x65: case 0x66: case 0x67:
    case 0x68: case 0x69: case 0x6a: case 0x6b:
    case 0x6c: case 0x6d: case 0x6e: case 0x6f:
    {
      int type = ch - 0x60;
      String []def = _classDefs.get(type);
      len = def.length - 1;
      for (int i = 0; i < len; i++) {
        skipObject();
      }
      return true;
    }

      // direct fixed typed list
    case 0x70: case 0x71: case 0x72: case 0x73:
    case 0x74: case 0x75: case 0x76: case 0x77:
      skipObject();
      len = ch - 0x70;
      for (int i = 0; i < len; i++) {
        skipObject();
      }
      return true;
      
      // direct fixed untyped list
    case 0x78: case 0x79: case 0x7a: case 0x7b:
    case 0x7c: case 0x7d: case 0x7e: case 0x7f:
      len = ch - 0x78;
      for (int i = 0; i < len; i++) {
        skipObject();
      }
      return true;
      
      // int single-byte
    case 0x80: case 0x81: case 0x82: case 0x83:
    case 0x84: case 0x85: case 0x86: case 0x87:
    case 0x88: case 0x89: case 0x8a: case 0x8b:
    case 0x8c: case 0x8d: case 0x8e: case 0x8f:
      
    case 0x90: case 0x91: case 0x92: case 0x93:
    case 0x94: case 0x95: case 0x96: case 0x97:
    case 0x98: case 0x99: case 0x9a: case 0x9b:
    case 0x9c: case 0x9d: case 0x9e: case 0x9f:
      
    case 0xa0: case 0xa1: case 0xa2: case 0xa3:
    case 0xa4: case 0xa5: case 0xa6: case 0xa7:
    case 0xa8: case 0xa9: case 0xaa: case 0xab:
    case 0xac: case 0xad: case 0xae: case 0xaf:
      
    case 0xb0: case 0xb1: case 0xb2: case 0xb3:
    case 0xb4: case 0xb5: case 0xb6: case 0xb7:
    case 0xb8: case 0xb9: case 0xba: case 0xbb:
    case 0xbc: case 0xbd: case 0xbe: case 0xbf:
      return true;
      
      // int two-byte
    case 0xc0: case 0xc1: case 0xc2: case 0xc3:
    case 0xc4: case 0xc5: case 0xc6: case 0xc7:
    case 0xc8: case 0xc9: case 0xca: case 0xcb:
    case 0xcc: case 0xcd: case 0xce: case 0xcf:
      skip(1);
      return true;
      
      // int three-byte
    case 0xd0: case 0xd1: case 0xd2: case 0xd3:
    case 0xd4: case 0xd5: case 0xd6: case 0xd7:
      skip(2);
      return true;
      
      // long single-byte
    case 0xd8: case 0xd9: case 0xda: case 0xdb:
    case 0xdc: case 0xdd: case 0xde: case 0xdf:
      
    case 0xe0: case 0xe1: case 0xe2: case 0xe3:
    case 0xe4: case 0xe5: case 0xe6: case 0xe7:
    case 0xe8: case 0xe9: case 0xea: case 0xeb:
    case 0xec: case 0xed: case 0xee: case 0xef:
      return true;

      // long two-byte
    case 0xf0: case 0xf1: case 0xf2: case 0xf3:
    case 0xf4: case 0xf5: case 0xf6: case 0xf7:
    case 0xf8: case 0xf9: case 0xfa: case 0xfb:
    case 0xfc: case 0xfd: case 0xfe: case 0xff:
      skip(1);
      return true;
      
    
    default:
      throw new UnsupportedOperationException("0x" + Integer.toHexString(ch));
    }
  }
955868
def forward_lines(size = 10)

      file   = @file
      result = ""

      while result.scan(/\r\n|\r|\n/).size < size && !file.eof?

        result += file.gets
      end

      result
    end
305294
protected void skipStatements() throws IOException {
		while (true) {
			st.nextToken();
			if (null != st.sval && st.sval.equalsIgnoreCase("VALUES")) {
				// the next token is the begin of a value
				break;
			}
			if (st.ttype == StreamTokenizer.TT_EOF) {
				// the end of the file is reached
				EOF_reached = true;
				break;
			}
		}
	}
890832
public boolean skipPreamble () throws IOException
  {
    // First delimiter may be not preceeded with a CRLF.
    System.arraycopy (m_aBoundary, 2, m_aBoundary, 0, m_aBoundary.length - 2);
    m_nBoundaryLength = m_aBoundary.length - 2;
    try
    {
      // Discard all data up to the delimiter.
      discardBodyData ();

      // Read boundary - if succeded, the stream contains an
      // encapsulation.
      return readBoundary ();
    }
    catch (final MultipartMalformedStreamException e)
    {
      return false;
    }
    finally
    {
      // Restore delimiter.
      System.arraycopy (m_aBoundary, 0, m_aBoundary, 2, m_aBoundary.length - 2);
      m_nBoundaryLength = m_aBoundary.length;
      m_aBoundary[0] = CR;
      m_aBoundary[1] = LF;
    }
  }
1191771
private int skipDelimiters(int startPos) {
        if (delimiters == null)
            throw new NullPointerException();

        int position = startPos;
        while (!retDelims && position < maxPosition) {
            if (!hasSurrogates) {
                char c = str.charAt(position);
                if ((c > maxDelimCodePoint) || (delimiters.indexOf(c) < 0))
                    break;
                position++;
            } else {
                int c = str.codePointAt(position);
                if ((c > maxDelimCodePoint) || !isDelimiter(c)) {
                    break;
                }
                position += Character.charCount(c);
            }
        }
        return position;
    }
1126175
def before_blobput(self, field: str, fileobj: BinaryIO,
                       filename: str,
                       mimetype: Optional[str] = None,
                       size: Optional[int] = None,
                       encoding: Optional[str] = None) -> None:
        """"""
549437
public boolean skipPreamble()
            throws IOException {
        // First delimiter may be not preceeded with a CRLF.
        System.arraycopy(boundary, 2, boundary, 0, boundary.length - 2);
        boundaryLength = boundary.length - 2;
        try {
            // Discard all data up to the delimiter.
            discardBodyData();

            // Read boundary - if succeded, the stream contains an
            // encapsulation.
            return readBoundary();
        } catch (MalformedStreamException e) {
            return false;
        } finally {
            // Restore delimiter.
            System.arraycopy(boundary, 0, boundary, 2, boundary.length - 2);
            boundaryLength = boundary.length;
            boundary[0] = CR;
            boundary[1] = LF;
        }
    }
1366850
def _skip_frame(self):
        """"""
        size = self.read_size()
        for i in range(size+1):
            line = self._f.readline()
            if len(line) == 0:
                raise StopIteration
278226
private int skipForward(char[] chars, int start, int length) {
    if (tc.isEntryEnabled())
      tc.entry(this,cclass, "skipForward", new Object[]{chars,new Integer(start),
        new Integer(length)});
    int ans = length;
    for (int i = 0; i < length; i++)
      if (chars[start+i] == MatchSpace.SUBTOPIC_SEPARATOR_CHAR) {
        ans = i;
        break;
      }
    if (tc.isEntryEnabled())
      tc.exit(this,cclass, "skipForward", new Integer(ans));
    return ans;
  }
721114
public void skip(int length) {
        int newcount = count + length;
        if (newcount > buf.length) {
            buf = Arrays.copyOf(buf, oversize(newcount));
        }
        count = newcount;
    }
778421
def _skip_frame(self):
        """"""
        for line in self._f:
            if line == 'ITEM: ATOMS\n':
                break
        for i in range(self.num_atoms):
            next(self._f)
858420
@Override
	public long skip(long n) throws IOException {
		// Skip in the queue
		synchronized(file) {
			while(true) {
				long fileLen=file.getLength();
				if(fileLen>=1) {
					long pos=file.getFirstIndex();
					long skipSize=fileLen>n?n:fileLen;
					// When at the end of the file, skip the remaining bytes
					if((pos+skipSize)>file.maxFifoLength) skipSize=file.maxFifoLength-pos;

					// Skip as many bytes as currently available
					long totalSkipped=skipSize;
					long newFirstIndex=pos+skipSize;
					while(newFirstIndex>=file.maxFifoLength) newFirstIndex-=file.maxFifoLength;
					file.setFirstIndex(newFirstIndex);
					file.setLength(fileLen-skipSize);
					file.notify();
					return totalSkipped;
				}
				try {
					file.wait();
				} catch(InterruptedException err) {
					InterruptedIOException ioErr=new InterruptedIOException();
					ioErr.initCause(err);
					throw ioErr;
				}
			}
		}
	}
1141517
def skipBytes(self, nroBytes):
        
        self.data.seek(nroBytes + self.data.tell())
231976
def get_file_size(file_object):
    ''''''
    position = file_object.tell()

    file_object.seek(0, 2)
    file_size = file_object.tell()
    file_object.seek(position, 0)

    return file_size
1068509
def fastqIterate(infile):
    ''''''

    def convert2string(b):
        if type(b) == str:
            return b
        else:
            return b.decode("utf-8")

    while 1:
        line1 = convert2string(infile.readline())
        if not line1:
            break
        if not line1.startswith('@'):
            U.error("parsing error: expected '@' in line %s" % line1)
        line2 = convert2string(infile.readline())
        line3 = convert2string(infile.readline())
        if not line3.startswith('+'):
            U.error("parsing error: expected '+' in line %s" % line3)
        line4 = convert2string(infile.readline())
        # incomplete entry
        if not line4:
            U.error("incomplete entry for %s" % line1)

        yield Record(line1[1:-1], line2[:-1], line4[:-1])
840488
def file_path_short(self):
        
        if not hasattr(self, '_file_path_short'):
            if self.file_path:
                result = None

                for path in sys.path:
                    # On Windows, if self.file_path and path are on different drives, relpath
                    # will result in exception, because it cannot compute a relpath in this case.
                    # The root cause is that on Windows, there is no root dir like '/' on Linux.
                    try:
                        candidate = os.path.relpath(self.file_path, path)
                    except ValueError:
                        continue

                    if not result or (len(candidate.split(os.sep)) < len(result.split(os.sep))):
                        result = candidate

                self._file_path_short = result
            else:
                self._file_path_short = None

        return self._file_path_short