@Override public String toString() { return String.format("Dataset %s for %d buffer(s) and %d relations", getName(), bufferNames.length, relations.length); }
public static IDatasetElement fromDebugSegment(String name, Set<AccessType> accessType, byte[] segment, int currentPos, int textAreaOffset, ByteOrder order) { int bufferCount = ByteBuffer.wrap(segment, currentPos, Short.BYTES).order(order).getShort(); int relationshipCount = ByteBuffer.wrap(segment, currentPos + 2, Short.BYTES).order(order).getShort(); int nameOffset = ByteBuffer.wrap(segment, currentPos + 16, Integer.BYTES).order(order).getInt(); String name2 = nameOffset == 0 ? name : RCodeInfo.readNullTerminatedString(segment, textAreaOffset + nameOffset); String[] bufferNames = new String[bufferCount]; for (int zz = 0; zz < bufferCount; zz++) { bufferNames[zz] = RCodeInfo.readNullTerminatedString(segment, textAreaOffset + ByteBuffer.wrap(segment, currentPos + 24 + (zz * 4), Integer.BYTES).order(order).getInt()); } // Round to next byte int currPos = currentPos + 24 + (bufferCount * 4 + 7 & -8); IDataRelationElement[] relations = new DataRelationElementV11[relationshipCount]; for (int zz = 0; zz < relationshipCount; zz++) { IDataRelationElement param = DataRelationElementV11.fromDebugSegment(segment, currPos, textAreaOffset, order); currPos += param.getSizeInRCode(); relations[zz] = param; } return new DatasetElementV11(name2, accessType, bufferNames, relations); }
break; case DATASET: IDatasetElement ds = DatasetElementV11.fromDebugSegment(name, set, segment, currOffset, textAreaOffset, order); currOffset += ds.getSizeInRCode(); break;
public static IDatasetElement fromDebugSegment(String name, Set<AccessType> accessType, byte[] segment, int currentPos, int textAreaOffset, ByteOrder order) { int bufferCount = ByteBuffer.wrap(segment, currentPos, Short.BYTES).order(order).getShort(); int relationshipCount = ByteBuffer.wrap(segment, currentPos + 2, Short.BYTES).order(order).getShort(); int nameOffset = ByteBuffer.wrap(segment, currentPos + 16, Integer.BYTES).order(order).getInt(); String name2 = nameOffset == 0 ? name : RCodeInfo.readNullTerminatedString(segment, textAreaOffset + nameOffset); String[] bufferNames = new String[bufferCount]; for (int zz = 0; zz < bufferCount; zz++) { bufferNames[zz] = RCodeInfo.readNullTerminatedString(segment, textAreaOffset + ByteBuffer.wrap(segment, currentPos + 24 + (zz * 4), Integer.BYTES).order(order).getInt()); } int currPos = currentPos + 4 * bufferCount; IDataRelationElement[] relations = new DataRelationElementV11[relationshipCount]; for (int zz = 0; zz < relationshipCount; zz++) { IDataRelationElement param = DataRelationElementV11.fromDebugSegment(segment, currPos, textAreaOffset, order); currPos += param.getSizeInRCode(); relations[zz] = param; } return new DatasetElementV11(name2, accessType, bufferNames, relations); }
break; case DATASET: IDatasetElement ds = DatasetElementV11.fromDebugSegment(name, set, segment, currOffset, textAreaOffset, order); currOffset += ds.getSizeInRCode(); break;
@Override public String toString() { return String.format("Dataset %s for %d buffer(s) and %d relations", getName(), bufferNames.length, relations.length); }