Examples of IOHandleInstance


Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        return h;
    }

    public static SixModelObject getstderr(ThreadContext tc) {
        SixModelObject IOType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.ioType;
        IOHandleInstance h = (IOHandleInstance)IOType.st.REPR.allocate(tc, IOType.st);
        h.handle = new StandardWriteHandle(tc, tc.gc.err);
        return h;
    }
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        return h;
    }

    public static SixModelObject setencoding(SixModelObject obj, String encoding, ThreadContext tc) {
        if (obj instanceof IOHandleInstance) {
            IOHandleInstance h = (IOHandleInstance)obj;

            Charset cs;
            if (encoding.equals("ascii"))
                cs = Charset.forName("US-ASCII");
            else if (encoding.equals("iso-8859-1"))
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        return obj;
    }

    public static SixModelObject setinputlinesep(SixModelObject obj, String sep, ThreadContext tc) {
        if (obj instanceof IOHandleInstance) {
            IOHandleInstance h = (IOHandleInstance)obj;

            if (h.handle instanceof IIOLineSeparable)
                ((IIOLineSeparable)h.handle).setInputLineSeparator(tc, sep);
            else
                throw ExceptionHandling.dieInternal(tc,
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        return obj;
    }

    public static SixModelObject seekfh(SixModelObject obj, long offset, long whence, ThreadContext tc) {
        if (obj instanceof IOHandleInstance) {
            IOHandleInstance h = (IOHandleInstance)obj;
            if (h.handle instanceof IIOSeekable) {
                ((IIOSeekable)h.handle).seek(tc, offset, whence);
                return obj;
            }
            else
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        }
    }

    public static long tellfh(SixModelObject obj, ThreadContext tc) {
        if (obj instanceof IOHandleInstance) {
            IOHandleInstance h = (IOHandleInstance)obj;
            if (h.handle instanceof IIOSeekable)
                return ((IIOSeekable)h.handle).tell(tc);
            else
                throw ExceptionHandling.dieInternal(tc,
                    "This handle does not support tell");
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        }
    }

    public static SixModelObject readfh(SixModelObject io, SixModelObject res, long bytes, ThreadContext tc) {
        if (io instanceof IOHandleInstance) {
            IOHandleInstance h = (IOHandleInstance)io;
            if (h.handle instanceof IIOSyncReadable) {
                if (res instanceof VMArrayInstance_i8) {
                    VMArrayInstance_i8 arr = (VMArrayInstance_i8)res;

                    byte[] array = ((IIOSyncReadable)h.handle).read(tc, (int)bytes);
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

    public static long writefh(SixModelObject obj, SixModelObject buf, ThreadContext tc) {
        ByteBuffer bb = Buffers.unstashBytes(buf, tc);
        long written;
        if (obj instanceof IOHandleInstance) {
            IOHandleInstance h = (IOHandleInstance)obj;
            byte[] bytesToWrite = new byte[bb.limit()];
            bb.get(bytesToWrite);
            if (h.handle instanceof IIOSyncWritable)
                written = ((IIOSyncWritable)h.handle).write(tc, bytesToWrite);
            else
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

    }

    public static long printfh(SixModelObject obj, String data, ThreadContext tc) {
        long written;
        if (obj instanceof IOHandleInstance) {
            IOHandleInstance h = (IOHandleInstance)obj;
            if (h.handle instanceof IIOSyncWritable)
                written = ((IIOSyncWritable)h.handle).print(tc, data);
            else
                throw ExceptionHandling.dieInternal(tc,
                    "This handle does not support print");
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

    }

    public static long sayfh(SixModelObject obj, String data, ThreadContext tc) {
        long written;
        if (obj instanceof IOHandleInstance) {
            IOHandleInstance h = (IOHandleInstance)obj;
            if (h.handle instanceof IIOSyncWritable)
                written = ((IIOSyncWritable)h.handle).say(tc, data);
            else
                throw ExceptionHandling.dieInternal(tc,
                    "This handle does not support say");
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        return written;
    }

    public static SixModelObject flushfh(SixModelObject obj, ThreadContext tc) {
        if (obj instanceof IOHandleInstance) {
            IOHandleInstance h = (IOHandleInstance)obj;
            if (h.handle instanceof IIOSyncWritable)
                ((IIOSyncWritable)h.handle).flush(tc);
            else
                throw ExceptionHandling.dieInternal(tc,
                    "This handle does not support flush");
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.