private void fixBrokenTrailingCharacter(ByteList result) throws IOException { // fix broken trailing character int extraBytes = StringSupport.bytesToFixBrokenTrailingCharacter(result.getUnsafeBytes(), result.getBegin(), result.getRealSize(), getReadEncoding(), result.length()); for (int i = 0; i < extraBytes; i++) { int read = bufferedStream.read(); if (read == -1) break; result.append(read); } }
public static int bytesToFixBrokenTrailingCharacter(ByteList val, int usingLength) { return bytesToFixBrokenTrailingCharacter(val.getUnsafeBytes(), val.getBegin(), val.getRealSize(), val.getEncoding(), usingLength); }
public static int bytesToFixBrokenTrailingCharacter(ByteList val, int usingLength) { return bytesToFixBrokenTrailingCharacter(val.getUnsafeBytes(), val.getBegin(), val.getRealSize(), val.getEncoding(), usingLength); }
private void fixBrokenTrailingCharacter(ByteList result) throws IOException { // fix broken trailing character int extraBytes = StringSupport.bytesToFixBrokenTrailingCharacter(result.getUnsafeBytes(), result.getBegin(), result.getRealSize(), getReadEncoding(), result.length()); for (int i = 0; i < extraBytes; i++) { int read = bufferedStream.read(); if (read == -1) break; result.append(read); } }
public static int bytesToFixBrokenTrailingCharacter(ByteList val, int usingLength) { return bytesToFixBrokenTrailingCharacter(val.getUnsafeBytes(), val.getBegin(), val.getRealSize(), val.getEncoding(), usingLength); }
private void fixBrokenTrailingCharacter(ByteList result) throws IOException { // fix broken trailing character int extraBytes = StringSupport.bytesToFixBrokenTrailingCharacter(result.getUnsafeBytes(), result.getBegin(), result.getRealSize(), getReadEncoding(), result.length()); for (int i = 0; i < extraBytes; i++) { int read = bufferedStream.read(); if (read == -1) break; result.append(read); } }
private void fixBrokenTrailingCharacter(ByteList result) throws IOException { // fix broken trailing character int extraBytes = StringSupport.bytesToFixBrokenTrailingCharacter(result.getUnsafeBytes(), result.getBegin(), result.getRealSize(), getReadEncoding(), result.length()); for (int i = 0; i < extraBytes; i++) { int read = bufferedStream.read(); if (read == -1) break; result.append(read); } }
public static int bytesToFixBrokenTrailingCharacter(ByteList val, int usingLength) { return bytesToFixBrokenTrailingCharacter(val.getUnsafeBytes(), val.getBegin(), val.getRealSize(), val.getEncoding(), usingLength); }
@JRubyMethod(name = "getc") public IRubyObject getc(ThreadContext context) { checkReadable(); if (isEndOfString()) return context.nil; StringIOData ptr = this.ptr; synchronized (ptr) { int start = ptr.pos; int total = 1 + StringSupport.bytesToFixBrokenTrailingCharacter(ptr.string.getByteList(), start + 1); ptr.pos += total; return context.runtime.newString(ptr.string.getByteList().makeShared(start, total)); } }
@JRubyMethod(name = "getc") public IRubyObject getc(ThreadContext context) { checkReadable(); if (isEndOfString()) return context.nil; StringIOData ptr = this.ptr; synchronized (ptr) { int start = ptr.pos; int total = 1 + StringSupport.bytesToFixBrokenTrailingCharacter(ptr.string.getByteList(), start + 1); ptr.pos += total; return context.runtime.newString(ptr.string.getByteList().makeShared(start, total)); } }
@JRubyMethod(name = "getc", compat = CompatVersion.RUBY1_9) public IRubyObject getc(ThreadContext context) { checkReadable(); if (isEndOfString()) return context.runtime.getNil(); int start = ptr.pos; int total = 1 + StringSupport.bytesToFixBrokenTrailingCharacter(ptr.string.getByteList(), start + 1); ptr.pos += total; return context.runtime.newString(ptr.string.getByteList().makeShared(start, total)); }
@JRubyMethod(name = "getc", compat = CompatVersion.RUBY1_9) public IRubyObject getc(ThreadContext context) { checkReadable(); if (isEndOfString()) return context.runtime.getNil(); int start = ptr.pos; int total = 1 + StringSupport.bytesToFixBrokenTrailingCharacter(ptr.string.getByteList(), start + 1); ptr.pos += total; return context.runtime.newString(ptr.string.getByteList().makeShared(start, total)); }
bytesToUse += StringSupport.bytesToFixBrokenTrailingCharacter(ptr.string.getByteList(), bytesToUse);
bytesToUse += StringSupport.bytesToFixBrokenTrailingCharacter(ptr.string.getByteList(), bytesToUse);