Examples of LazySize


Examples of org.jboss.classfilewriter.util.LazySize

    }


    @Override
    public void writeData(ByteArrayDataOutputStream stream) throws IOException {
        LazySize sizeMarker = stream.writeSize();
        stream.writeByte(noParameters);
        for(int i = 0; i < noParameters; ++ i) {
            if(!annotations.containsKey(i)) {
                stream.writeShort(0);
            } else {
                List<ClassAnnotation> ans = annotations.get(i);
                stream.writeShort(ans.size());
                for (ClassAnnotation annotation : ans) {
                    annotation.write(stream);
                }
            }
        }
        sizeMarker.markEnd();
    }
View Full Code Here

Examples of org.jboss.classfilewriter.util.LazySize

    }


    @Override
    public void writeData(ByteArrayDataOutputStream stream) throws IOException {
        LazySize sizeMarker = stream.writeSize();
        stream.writeShort(annotations.size());
        for (ClassAnnotation annotation : annotations) {
            annotation.write(stream);
        }
        sizeMarker.markEnd();
    }
View Full Code Here

Examples of org.jboss.classfilewriter.util.LazySize

        // now we need to write the stack frames.
        // for now we are going to write all frames as full frames
        // TODO: optimise the frame creation

        // write to dstream
        LazySize size = stream.writeSize();
        stream.writeShort(ca.getStackFrames().size());
        int lastPos = -1;
        for (Entry<Integer, StackFrame> entry : method.getCodeAttribute().getStackFrames().entrySet()) {
            int offset = entry.getKey() - lastPos - 1;
            lastPos = entry.getKey();
            StackFrame frame = entry.getValue();
            if (frame.getType() == StackFrameType.SAME_FRAME || frame.getType() == StackFrameType.SAME_FRAME_EXTENDED) {
                writeSameFrame(stream, offset, lastPos, frame);
            } else if (frame.getType() == StackFrameType.SAME_LOCALS_1_STACK && offset < (127 - 64)) {
                writeSameLocals1Stack(stream, offset, lastPos, frame);
            } else {
                writeFullFrame(stream, offset, lastPos, entry.getValue());
            }
        }
        size.markEnd();
    }
View Full Code Here

Examples of org.jboss.classfilewriter.util.LazySize

        byte[] bytecode = finalDataBytes.toByteArray();
        for (Entry<Integer, Integer> e : jumpLocations.entrySet()) {
            overwriteShort(bytecode, e.getKey(), e.getValue());
        }

        LazySize size = stream.writeSize();
        stream.writeShort(maxStackDepth);
        stream.writeShort(maxLocals);
        stream.writeInt(bytecode.length);
        stream.write(bytecode);
        stream.writeShort(exceptionTable.size()); // exception table length
        for (ExceptionHandler exception : exceptionTable) {
            stream.writeShort(exception.getStart());
            stream.writeShort(exception.getEnd());
            stream.writeShort(exception.getHandler());
            stream.writeShort(exception.getExceptionIndex());
        }
        stream.writeShort(attributes.size()); // attributes count
        for (Attribute attribute : attributes) {
            attribute.write(stream);
        }
        size.markEnd();;
    }
View Full Code Here

Examples of org.jboss.classfilewriter.util.LazySize

        // now we need to write the stack frames.
        // for now we are going to write all frames as full frames
        // TODO: optimise the frame creation

        // write to dstream
        LazySize size = stream.writeSize();
        stream.writeShort(ca.getStackFrames().size());
        int lastPos = -1;
        for (Entry<Integer, StackFrame> entry : method.getCodeAttribute().getStackFrames().entrySet()) {
            int offset = entry.getKey() - lastPos - 1;
            lastPos = entry.getKey();
            StackFrame frame = entry.getValue();
            if (frame.getType() == StackFrameType.SAME_FRAME || frame.getType() == StackFrameType.SAME_FRAME_EXTENDED) {
                writeSameFrame(stream, offset, lastPos, frame);
            } else if (frame.getType() == StackFrameType.SAME_LOCALS_1_STACK && offset < (127 - 64)) {
                writeSameLocals1Stack(stream, offset, lastPos, frame);
            } else {
                writeFullFrame(stream, offset, lastPos, entry.getValue());
            }
        }
        size.markEnd();
    }
View Full Code Here

Examples of org.jboss.classfilewriter.util.LazySize

        }
        for (Entry<Integer, Integer> e : jumpLocations32.entrySet()) {
            overwriteInt(bytecode, e.getKey(), e.getValue());
        }

        LazySize size = stream.writeSize();
        stream.writeShort(maxStackDepth);
        stream.writeShort(maxLocals);
        stream.writeInt(bytecode.length);
        stream.write(bytecode);
        stream.writeShort(exceptionTable.size()); // exception table length
        for (ExceptionHandler exception : exceptionTable) {
            stream.writeShort(exception.getStart());
            stream.writeShort(exception.getEnd());
            stream.writeShort(exception.getHandler());
            stream.writeShort(exception.getExceptionIndex());
        }
        stream.writeShort(attributes.size()); // attributes count
        for (Attribute attribute : attributes) {
            attribute.write(stream);
        }
        size.markEnd();
        ;
    }
View Full Code Here

Examples of org.jboss.classfilewriter.util.LazySize

    }


    @Override
    public void writeData(ByteArrayDataOutputStream stream) throws IOException {
        LazySize sizeMarker = stream.writeSize();
        stream.writeByte(noParameters);
        for(int i = 0; i < noParameters; ++ i) {
            if(!annotations.containsKey(i)) {
                stream.writeShort(0);
            } else {
                List<ClassAnnotation> ans = annotations.get(i);
                stream.writeShort(ans.size());
                for (ClassAnnotation annotation : ans) {
                    annotation.write(stream);
                }
            }
        }
        sizeMarker.markEnd();
    }
View Full Code Here

Examples of org.jboss.classfilewriter.util.LazySize

    }


    @Override
    public void writeData(ByteArrayDataOutputStream stream) throws IOException {
        LazySize sizeMarker = stream.writeSize();
        stream.writeShort(annotations.size());
        for (ClassAnnotation annotation : annotations) {
            annotation.write(stream);
        }
        sizeMarker.markEnd();
    }
View Full Code Here

Examples of org.jboss.classfilewriter.util.LazySize

        byte[] bytecode = finalDataBytes.toByteArray();
        for (Entry<Integer, Integer> e : jumpLocations.entrySet()) {
            overwriteShort(bytecode, e.getKey(), e.getValue());
        }

        LazySize size = stream.writeSize();
        stream.writeShort(maxStackDepth);
        stream.writeShort(maxLocals);
        stream.writeInt(bytecode.length);
        stream.write(bytecode);
        stream.writeShort(exceptionTable.size()); // exception table length
        for (ExceptionHandler exception : exceptionTable) {
            stream.writeShort(exception.getStart());
            stream.writeShort(exception.getEnd());
            stream.writeShort(exception.getHandler());
            stream.writeShort(exception.getExceptionIndex());
        }
        stream.writeShort(attributes.size()); // attributes count
        for (Attribute attribute : attributes) {
            attribute.write(stream);
        }
        size.markEnd();;
    }
View Full Code Here

Examples of org.jboss.classfilewriter.util.LazySize

        byte[] bytecode = finalDataBytes.toByteArray();
        for (Entry<Integer, Integer> e : jumpLocations.entrySet()) {
            overwriteShort(bytecode, e.getKey(), e.getValue());
        }

        LazySize size = stream.writeSize();
        stream.writeShort(maxStackDepth);
        stream.writeShort(maxLocals);
        stream.writeInt(bytecode.length);
        stream.write(bytecode);
        stream.writeShort(exceptionTable.size()); // exception table length
        for (ExceptionHandler exception : exceptionTable) {
            stream.writeShort(exception.getStart());
            stream.writeShort(exception.getEnd());
            stream.writeShort(exception.getHandler());
            stream.writeShort(exception.getExceptionIndex());
        }
        stream.writeShort(attributes.size()); // attributes count
        for (Attribute attribute : attributes) {
            attribute.write(stream);
        }
        size.markEnd();;
    }
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.