public void writeArray(Collection<? extends EncodedValue> elements) throws IOException { writer.writeEncodedValueHeader(ValueType.ARRAY, 0); writer.writeUleb128(elements.size()); for (EncodedValue element : elements) { writeEncodedValue(element); } }
public void writeAnnotation( TypeKey annotationType, Collection<? extends AnnotationElement> elements) throws IOException { writer.writeEncodedValueHeader(ValueType.ANNOTATION, 0); writer.writeUleb128(typeSection.getItemIndex(annotationType)); writer.writeUleb128(elements.size()); Collection<? extends AnnotationElement> sortedElements = Ordering.from(BaseAnnotationElement.BY_NAME).immutableSortedCopy(elements); for (AnnotationElement element : sortedElements) { writer.writeUleb128(stringSection.getItemIndex(annotationSection.getElementName(element))); writeEncodedValue(annotationSection.getElementValue(element)); } }
public void writeString(@Nonnull StringKey value) throws IOException { writer.writeEncodedUint(ValueType.STRING, stringSection.getItemIndex(value)); }
public void writeType(@Nonnull TypeKey value) throws IOException { writer.writeEncodedUint(ValueType.TYPE, typeSection.getItemIndex(value)); }
public void writeNull() throws IOException { writer.write(ValueType.NULL); }
public void writeShort(int value) throws IOException { writer.writeEncodedInt(ValueType.SHORT, value); }
public void writeLong(long value) throws IOException { writer.writeEncodedLong(ValueType.LONG, value); }
public void writeMethod(@Nonnull MethodRefKey value) throws IOException { writer.writeEncodedUint(ValueType.METHOD, methodSection.getItemIndex(value)); }
public void writeFloat(float value) throws IOException { writer.writeEncodedFloat(ValueType.FLOAT, value); }
public void writeInt(int value) throws IOException { writer.writeEncodedInt(ValueType.INT, value); }
public void writeField(@Nonnull FieldRefKey value) throws IOException { writer.writeEncodedUint(ValueType.FIELD, fieldSection.getItemIndex(value)); }
public void writeDouble(double value) throws IOException { writer.writeEncodedDouble(ValueType.DOUBLE, value); }
public void writeChar(char value) throws IOException { writer.writeEncodedUint(ValueType.CHAR, value); }
public void writeByte(byte value) throws IOException { writer.writeEncodedInt(ValueType.BYTE, value); }
public void writeBoolean(boolean value) throws IOException { writer.writeEncodedValueHeader(ValueType.BOOLEAN, value ? 1 : 0); }