/** * Dump source file attribute to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { super.dump(file); if (super.getLength() > 0) { file.write(bytes, 0, super.getLength()); } }
/** * Dump source file attribute to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { super.dump(file); if (super.getLength() > 0) { file.write(bytes, 0, super.getLength()); } }
/** * @return String representation. */ @Override public final String toString() { final StringBuilder buf = new StringBuilder("Synthetic"); if (super.getLength() > 0) { buf.append(" ").append(Utility.toHexString(bytes)); } return buf.toString(); }
/** * @return the full size of this code attribute, minus its first 6 bytes, * including the size of all its contained attributes */ private int calculateLength() { int len = 0; if (attributes != null) { for (final Attribute attribute : attributes) { len += attribute.getLength() + 6 /*attribute header size*/; } } return len + getInternalLength(); }
/** * @return String representation. */ @Override public final String toString() { if (super.getLength() == 0 || bytes == null) { return "(Unknown attribute " + name + ")"; } String hex; if (super.getLength() > 10) { final byte[] tmp = new byte[10]; System.arraycopy(bytes, 0, tmp, 0, 10); hex = Utility.toHexString(tmp) + "... (truncated)"; } else { hex = Utility.toHexString(bytes); } return "(Unknown attribute " + name + ": " + hex + ")"; }
for (final Attribute attr : attributes) { final int attributeNameIndex = attr.getNameIndex(); final int length = attr.getLength(); UTF8Entry utf8Entry = constantPool.getUTF8Entry(attributeNameIndex); if (utf8Entry == null) {
attrs_len += (code_attrs[i].getLength() + 6);
attrs_len += code_attr.getLength() + 6;