How to return the contents of jar files as an array of bytes?
I am trying to get the contents of the file as an array of bytes.
public static void main(String[] args) {
final IServiceClient client =
StorageConsumerProvider.getStorageServiceClient("dev");
String name = new File("C:\\Storage\\Model-1.0.0.jar").getName();
StorageObjectIdentifier objIdentifier = new
StorageObjectIdentifier("Model", "1.0.0", name);
// I need to pass the bytes here
client.createObject(objIdentifier, name.getBytes());
}
Interface is like this-
public void createObject(StorageObjectIdentifier objIdentifier, byte[] obj)
createObject method accepts two parameters, one of them is - the contents
of the file as an array of bytes
I am not sure how should I pass that as an array of bytes? Can anybody
help me with this? The file is a jar file in my case.
No comments:
Post a Comment