public int ungetc(int c) { if (c == -1) { return -1; } // putting a bit back, so we're not at EOF anymore eof = false; // save the ungot ungotChars.prepend((byte)c); return c; }
public int ungetc(int c) { if (c == -1) { return -1; } // putting a bit back, so we're not at EOF anymore eof = false; // save the ungot ungotChars.prepend((byte)c); return c; }
public int ungetc(int c) { if (c == -1) { return -1; } // putting a bit back, so we're not at EOF anymore eof = false; // save the ungot ungotChars.prepend((byte)c); return c; }
public int ungetc(int c) { if (c == -1) { return -1; } // putting a bit back, so we're not at EOF anymore eof = false; // save the ungot ungotChars.prepend((byte)c); return c; }
result.prepend((byte)ungotc); ungotc = -1;
public RubySymbol asInstanceVariable() { ByteList bytes = getBytes().dup(); bytes.prepend((byte) '@'); return newIDSymbol(getRuntime(), bytes); }
public RubySymbol asInstanceVariable() { ByteList bytes = getBytes().dup(); bytes.prepend((byte) '@'); return newIDSymbol(getRuntime(), bytes); }
public synchronized ByteList fread(int number) throws IOException, BadDescriptorException { try { if (number == 0) { if (eof) { return null; } else { return new ByteList(0); } } if (ungotc >= 0) { ByteList buf2 = bufferedRead(number - 1); buf2.prepend((byte)ungotc); ungotc = -1; return buf2; } return bufferedRead(number); } catch (EOFException e) { eof = true; return null; } }
public final RubyString prepend(byte ch) { modify(value.getRealSize() + 1); final int beg = value.getBegin(); if (beg > 0) { value.getUnsafeBytes()[beg - 1] = ch; value.setBegin(beg - 1); return this; } value.prepend(ch); return this; }
private void ungetbyteCommon(int c) { ptr.string.modify(); ptr.pos--; ByteList bytes = ptr.string.getByteList(); if (isEndOfString()) bytes.length((int)ptr.pos + 1); if (ptr.pos == -1) { bytes.prepend((byte)c); ptr.pos = 0; } else { bytes.set((int) ptr.pos, c); } }
private void ungetbyteCommon(int c) { ptr.string.modify(); ptr.pos--; ByteList bytes = ptr.string.getByteList(); if (isEndOfString()) bytes.length((int)ptr.pos + 1); if (ptr.pos == -1) { bytes.prepend((byte)c); ptr.pos = 0; } else { bytes.set((int) ptr.pos, c); } }
private void ungetbyteCommon(int c) { ptr.string.modify(); ptr.pos--; ByteList bytes = ptr.string.getByteList(); if (isEndOfString()) bytes.length((int)ptr.pos + 1); if (ptr.pos == -1) { bytes.prepend((byte)c); ptr.pos = 0; } else { bytes.set((int) ptr.pos, c); } }
public final RubyString prepend(byte ch) { modify(value.getRealSize() + 1); final int beg = value.getBegin(); if (beg > 0) { value.getUnsafeBytes()[beg - 1] = ch; value.setBegin(beg - 1); return this; } value.prepend(ch); return this; }
private void ungetbyteCommon(int c) { ptr.string.modify(); ptr.pos--; ByteList bytes = ptr.string.getByteList(); if (isEndOfString()) bytes.length((int)ptr.pos + 1); if (ptr.pos == -1) { bytes.prepend((byte)c); ptr.pos = 0; } else { bytes.set((int) ptr.pos, c); } }
private void ungetbyteCommon(int c) { StringIOData ptr = this.ptr; synchronized (ptr) { ptr.string.modify(); ptr.pos--; ByteList bytes = ptr.string.getByteList(); if (isEndOfString()) bytes.length(ptr.pos + 1); if (ptr.pos == -1) { bytes.prepend((byte) c); ptr.pos = 0; } else { bytes.set(ptr.pos, c); } } }
private void ungetbyteCommon(int c) { StringIOData ptr = this.ptr; synchronized (ptr) { ptr.string.modify(); ptr.pos--; ByteList bytes = ptr.string.getByteList(); if (isEndOfString()) bytes.length(ptr.pos + 1); if (ptr.pos == -1) { bytes.prepend((byte) c); ptr.pos = 0; } else { bytes.set(ptr.pos, c); } } }