MemoryFileSystem

Inheritance: java.lang.Object, com.aspose.threed.FileSystem

public class MemoryFileSystem extends FileSystem

Den MemoryFileSystem kommer att mappa läs-/skrivoperationerna till minnet. Example: Följande kod visar hur man exporterar en fil till minnet, inkluderar den beroende filen genom att använda MemoryFileSystem.

//create a scene with material
     Scene scene = new Scene();
     scene.getRootNode().createChildNode(new Box()).setMaterial(new LambertMaterial());
     //create a save option and specify the file system, so the dependent file will be written to memory
     var opt = FileFormat.WAVEFRONTOBJ.createSaveOptions();
     var mfs = new MemoryFileSystem();
     opt.setFileSystem(mfs);
     //obj's material file name is associated with the obj's file name, so we need a explicit name.
     opt.setFileName("test.obj");
     try (var ms = new MemoryStream())
     {
         scene.save(ms, opt);
     }
     //the test.obj was written to variable ms, and we can also get the test.mtl file content by
     var materialFile = mfs.getFileContent("test.mtl");

Konstruktörer

KonstruktorBeskrivning
MemoryFileSystem()

Metoder

MetodBeskrivning
close()Avsluta filsystemet och frigör dess resurser.
equals(Object arg0)
getClass()
getFileContent(String fileName)Returnerar det råa innehållet i den angivna filen.
getFileNames()Filnamn som finns i detta minnesfilsystem.
hashCode()
notify()
notifyAll()
readFile(String fileName, IOConfig options)Skapa en ström för att läsa beroenden.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)
writeFile(String fileName, IOConfig options)Skapa en ström för att skriva beroenden.

MemoryFileSystem()

public MemoryFileSystem()

close()

public void close()

Avsluta filsystemet och frigör dess resurser.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypBeskrivning
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getFileContent(String fileName)

public byte[] getFileContent(String fileName)

Returnerar det råa innehållet i den angivna filen. Kastar java.io.FileNotFoundException om den angivna filen inte finns.

Parameters:

ParameterTypBeskrivning
fileNamejava.lang.String

Returns: byte[]

getFileNames()

public List<String> getFileNames()

Filnamn som finns i detta minnesfilsystem.

Returns: java.util.List<java.lang.String>

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

readFile(String fileName, IOConfig options)

public Stream readFile(String fileName, IOConfig options)

Skapa en ström för att läsa beroenden.

Parameters:

ParameterTypBeskrivning
fileNamejava.lang.String
optionsIOConfig

Returns: com.aspose.csporter.helpers.Stream

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

ParameterTypBeskrivning
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypBeskrivning
arg0long
arg1int

writeFile(String fileName, IOConfig options)

public Stream writeFile(String fileName, IOConfig options)

Skapa en ström för att skriva beroenden.

Parameters:

ParameterTypBeskrivning
fileNamejava.lang.String
optionsIOConfig

Returns: com.aspose.csporter.helpers.Stream