The Dicom File Meta Information, as the name says, is meta information that gets attached to files. If yout get your Dicom data over the network, you can retrieve that information from the provided commandset and presentation context. In fact, if you want to write the received Dicom data to the file system, you need to create the File Meta Information, with that data.
Here is how this would look with dcm4che:
String classUid = commandSet.getString(Tag.AffectedSOPClassUID);
String instanceUid = commandSet.getString(Tag.AffectedSOPInstanceUID);
String transferSyntaxUid = presentationContext.getTransferSyntax();
Attributes fileMetaInformation = Attributes.createFileMetaInformation(classUid, instanceUid, transferSyntaxUid);
fileMetaInformation.setString(Tag.ImplementationClassUID, VR.UI, YOUR_IMPLEMENTATION_CLASS_UID);
fileMetaInformation.setString(Tag.ImplementationVersionName, VR.SH, YOUR_IMPLEMENTATION_VERSION_NAME);
fileMetaInformation.setString(Tag.SourceApplicationEntityTitle, VR.AE, association.getRemoteAET());
HTH ;),
Patrick