in jms-jpa/src/main/java/org/acme/DummyXAResource.java [129:141]
private Xid getXidFromFile(File file) throws IOException {
try (DataInputStream inputStream = new DataInputStream(new FileInputStream(file))) {
int formatId = inputStream.readInt();
int globalTransactionIdLength = inputStream.readInt();
byte[] globalTransactionId = new byte[globalTransactionIdLength];
inputStream.read(globalTransactionId, 0, globalTransactionIdLength);
int branchQualifierLength = inputStream.readInt();
byte[] branchQualifier = new byte[branchQualifierLength];
inputStream.read(branchQualifier, 0, branchQualifierLength);
return new XidImpl(formatId, globalTransactionId, branchQualifier);
}
}