Package abstrasy

Examples of abstrasy.Buffer$BufferOutputStream


        return null;
    }

    public Node external_mutator_from_buffer(Node startAt) throws Exception {
        startAt.isGoodArgsCnt(2);
        Buffer buffer = ((External_Buffer) AExtTools.getArgExternalInstance(startAt, 1, External_Buffer.class, Node.ACCESSVTYPE_MUTABLE_WRITELOCK)).getBuffer();
        if (buffer.length() > 0)
            number.getAndSet(new BigInteger(buffer.read_bytes()));
        else
            number.getAndSet(BigInteger.ZERO);
        return null;
    }
View Full Code Here


    }

   
    public Node external_to_buffer(Node startAt) throws Exception {
        startAt.isGoodArgsCnt(1);
        Buffer buffer = new Buffer();
        buffer.write_bytes(number.get().toByteArray());
        External_Buffer res = new External_Buffer();
        res.setBuffer(buffer);
        return Node.createExternal(res);
    }
View Full Code Here

    }
   
    public Node external_mutator_write_buffer(Node startAt) throws Exception {
        startAt.isGoodArgsCnt(2);
        SELF.require_SELF_mutable();
        Buffer buffer = ((External_Buffer) AExtTools.getArgExternalInstance(startAt, 1, External_Buffer.class,Node.ACCESSVTYPE_MUTABLE_WRITELOCK)).getBuffer();
        if(buffer.length()>0){
            byte[] buf=buffer.read_bytes();
            raf.write(buf);
        }
        return null;
    }
View Full Code Here

    }
   
    public Node external_mutator_read_buffer(Node startAt) throws Exception {
        startAt.isGoodArgsCnt(1,2);
        SELF.require_SELF_mutable();
        Buffer buffer=new Buffer();
        if(startAt.size()==2){
            int sz=(int)startAt.getSubNode(1, Node.TYPE_NUMBER).getNumber();
            byte[] buf = new byte[sz];
            int cread=raf.read(buf);
            if(cread>0){ buffer.write_bytes(buf, cread); }
        }
        else{
            byte[] buf = new byte[4096];
            int cread;
            while ((cread = raf.read(buf)) != -1) {
                if(cread>0){ buffer.write_bytes(buf, cread); }
            }
        }
        External_Buffer res=new External_Buffer();
        res.setBuffer(buffer);
        return Node.createExternal(res);
View Full Code Here

    }
   
    public Node external_mutator_read_chunked_buffer(Node startAt) throws Exception {
        startAt.isGoodArgsCnt(1);
        SELF.require_SELF_mutable();
        Buffer buffer=new Buffer();
        int sz = raf.readInt();
        byte[] buf = new byte[sz];
        int cread=raf.read(buf);
        if(cread>0){ buffer.write_bytes(buf, cread); }
        External_Buffer res=new External_Buffer();
        res.setBuffer(buffer);
        return Node.createExternal(res);
    }
View Full Code Here

    }
   
    public Node external_mutator_write_chunked_buffer(Node startAt) throws Exception {
        startAt.isGoodArgsCnt(2);
        SELF.require_SELF_mutable();
        Buffer buffer = ((External_Buffer) AExtTools.getArgExternalInstance(startAt, 1, External_Buffer.class,Node.ACCESSVTYPE_MUTABLE_WRITELOCK)).getBuffer();
        int len=buffer.length();
        raf.writeInt(len);
        if(buffer.length()>0){
            byte[] buf=buffer.read_bytes();
            raf.write(buf);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of abstrasy.Buffer$BufferOutputStream

Copyright © 2018 www.massapicom. 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.