Package org.jruby.util

Examples of org.jruby.util.ByteList.prepend()


                }
            }

            if (ungotc >= 0) {
                ByteList buf2 = bufferedRead(number - 1);
                buf2.prepend((byte)ungotc);
                ungotc = -1;
                return buf2;
            }

            return bufferedRead(number);
View Full Code Here


            // already have some bytes buffered, just return those

            ByteList result = bufferedRead(Math.min(buffer.remaining(), number));

            if (ungotc >= 0) {
                result.prepend((byte)ungotc);
                ungotc = -1;
            }
            return result;
        } else {
            // otherwise, we try an unbuffered read to get whatever's available
View Full Code Here

        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);
        }
    }
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.