/** * Creates a new ProgramClassWriter for writing to the given DataOutput. */ public ProgramClassWriter(DataOutput dataOutput) { this.dataOutput = new RuntimeDataOutput(dataOutput); }
/** * Creates a new ProgramClassWriter for writing to the given DataOutput. */ public ProgramClassWriter(DataOutput dataOutput) { this.dataOutput = new RuntimeDataOutput(dataOutput); }
/** * Creates a new ProgramClassWriter for writing to the given DataOutput. */ public ProgramClassWriter(DataOutput dataOutput) { this.dataOutput = new RuntimeDataOutput(dataOutput); }
/** * Creates a new ProgramClassWriter for reading from the given DataOutput. */ public ProgramClassWriter(DataOutput dataOutput) { this.dataOutput = new RuntimeDataOutput(dataOutput); }
public void visitAnyAttribute(Clazz clazz, Attribute attribute) { // Write the attribute name index. dataOutput.writeUnsignedShort(attribute.u2attributeNameIndex); // We'll write the attribute body into an array first, so we can // automatically figure out its length. ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); // Temporarily replace the current data output. RuntimeDataOutput oldDataOutput = dataOutput; dataOutput = new RuntimeDataOutput(new DataOutputStream(byteArrayOutputStream)); // Write the attribute body into the array. Note that the // accept method with two dummy null arguments never throws // an UnsupportedOperationException. attribute.accept(clazz, null, null, attributeBodyWriter); // Restore the original data output. dataOutput = oldDataOutput; // Write the attribute length and body. byte[] info = byteArrayOutputStream.toByteArray(); dataOutput.writeInt(info.length); dataOutput.write(info); }
public void visitAnyAttribute(Clazz clazz, Attribute attribute) { // Write the attribute name index. dataOutput.writeShort(attribute.u2attributeNameIndex); // We'll write the attribute body into an array first, so we can // automatically figure out its length. ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); // Temporarily replace the current data output. RuntimeDataOutput oldDataOutput = dataOutput; dataOutput = new RuntimeDataOutput(new DataOutputStream(byteArrayOutputStream)); // Write the attribute body into the array. Note that the // accept method with two dummy null arguments never throws // an UnsupportedOperationException. attribute.accept(clazz, null, null, attributeBodyWriter); // Restore the original data output. dataOutput = oldDataOutput; // Write the attribute length and body. byte[] info = byteArrayOutputStream.toByteArray(); dataOutput.writeInt(info.length); dataOutput.write(info); }
public void visitAnyAttribute(Clazz clazz, Attribute attribute) { // Write the attribute name index. dataOutput.writeUnsignedShort(attribute.u2attributeNameIndex); // We'll write the attribute body into an array first, so we can // automatically figure out its length. ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); // Temporarily replace the current data output. RuntimeDataOutput oldDataOutput = dataOutput; dataOutput = new RuntimeDataOutput(new DataOutputStream(byteArrayOutputStream)); // Write the attribute body into the array. Note that the // accept method with two dummy null arguments never throws // an UnsupportedOperationException. attribute.accept(clazz, null, null, attributeBodyWriter); // Restore the original data output. dataOutput = oldDataOutput; // Write the attribute length and body. byte[] info = byteArrayOutputStream.toByteArray(); dataOutput.writeInt(info.length); dataOutput.write(info); }
public void visitAnyAttribute(Clazz clazz, Attribute attribute) { // Write the attribute name index. dataOutput.writeUnsignedShort(attribute.u2attributeNameIndex); // We'll write the attribute body into an array first, so we can // automatically figure out its length. ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); // Temporarily replace the current data output. RuntimeDataOutput oldDataOutput = dataOutput; dataOutput = new RuntimeDataOutput(new DataOutputStream(byteArrayOutputStream)); // Write the attribute body into the array. Note that the // accept method with two dummy null arguments never throws // an UnsupportedOperationException. attribute.accept(clazz, null, null, attributeBodyWriter); // Restore the original data output. dataOutput = oldDataOutput; // Write the attribute length and body. byte[] info = byteArrayOutputStream.toByteArray(); dataOutput.writeInt(info.length); dataOutput.write(info); }