Package net.minecraft.nbt
Class NbtIo
java.lang.Object
net.minecraft.nbt.NbtIo
A set of utility functions for reading, writing, and scanning NBT files.
- Mappings:
- Namespace - Name - official - rb- intermediary - net/minecraft/class_2507- named - net/minecraft/nbt/NbtIo
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprivate static DataInputStreamdecompress(InputStream stream) Returns a new input stream that decompresses the inputstream.static NbtCompoundReads an NBT compound frominput.private static NbtElementread(DataInput input, int depth, NbtTagSizeTracker tracker) static NbtCompoundread(DataInput input, NbtTagSizeTracker tracker) Reads an NBT compound frominput.static @Nullable NbtCompoundReads an NBT compound fromfile.static NbtCompoundreadCompressed(File file) Reads an NBT compound from Gzip-compressedfile.static NbtCompoundreadCompressed(InputStream stream) Reads an NBT compound from Gzip-compressedstream.static voidscan(DataInput input, NbtScanner scanner) Scans the NBT input usingscanner.static voidscanCompressed(File file, NbtScanner scanner) Scans the compressed NBT file usingscanner.static voidscanCompressed(InputStream stream, NbtScanner scanner) Scans the compressed NBT stream usingscanner.static voidwrite(NbtCompound nbt, DataOutput output) Writes thenbttofile.static voidwrite(NbtCompound nbt, File file) Writes thenbttofile.static voidwrite(NbtElement nbt, DataOutput output) static voidwriteCompressed(NbtCompound nbt, File file) Writes the Gzip-compressednbttofile.static voidwriteCompressed(NbtCompound nbt, OutputStream stream) Writes the Gzip-compressednbttostream.
- 
Constructor Details- 
NbtIopublic NbtIo()
 
- 
- 
Method Details- 
readCompressedReads an NBT compound from Gzip-compressedfile.- Returns:
- the NBT compound from the file
- Throws:
- IOException- if the IO operation fails or if the root NBT element is not a compound
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lrb;a(Ljava/io/File;)Lqr;- intermediary - method_30613- Lnet/minecraft/class_2507;method_30613(Ljava/io/File;)Lnet/minecraft/class_2487;- named - readCompressed- Lnet/minecraft/nbt/NbtIo;readCompressed(Ljava/io/File;)Lnet/minecraft/nbt/NbtCompound;
 
- 
decompressReturns a new input stream that decompresses the inputstream.- Returns:
- a new input stream that decompresses the input stream
- Throws:
- IOException
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lrb;b(Ljava/io/InputStream;)Ljava/io/DataInputStream;- intermediary - method_40059- Lnet/minecraft/class_2507;method_40059(Ljava/io/InputStream;)Ljava/io/DataInputStream;- named - decompress- Lnet/minecraft/nbt/NbtIo;decompress(Ljava/io/InputStream;)Ljava/io/DataInputStream;
 
- 
readCompressedReads an NBT compound from Gzip-compressedstream.- Returns:
- the NBT compound from the stream
- Throws:
- IOException- if the IO operation fails or if the root NBT element is not a compound
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lrb;a(Ljava/io/InputStream;)Lqr;- intermediary - method_10629- Lnet/minecraft/class_2507;method_10629(Ljava/io/InputStream;)Lnet/minecraft/class_2487;- named - readCompressed- Lnet/minecraft/nbt/NbtIo;readCompressed(Ljava/io/InputStream;)Lnet/minecraft/nbt/NbtCompound;
 
- 
scanCompressedScans the compressed NBT file usingscanner.- Throws:
- IOException- if the IO operation fails
- See Also:
- API Note:
- This method does not return the scan result; the user is expected
 to call the appropriate method of the NbtScannersubclasses, such asNbtCollector.getRoot().
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lrb;a(Ljava/io/File;Lrh;)V- intermediary - method_40057- Lnet/minecraft/class_2507;method_40057(Ljava/io/File;Lnet/minecraft/class_6836;)V- named - scanCompressed- Lnet/minecraft/nbt/NbtIo;scanCompressed(Ljava/io/File;Lnet/minecraft/nbt/scanner/NbtScanner;)V
 
- 
scanCompressedScans the compressed NBT stream usingscanner.- Throws:
- IOException- if the IO operation fails
- See Also:
- API Note:
- This method does not return the scan result; the user is expected
 to call the appropriate method of the NbtScannersubclasses, such asNbtCollector.getRoot().
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lrb;a(Ljava/io/InputStream;Lrh;)V- intermediary - method_40058- Lnet/minecraft/class_2507;method_40058(Ljava/io/InputStream;Lnet/minecraft/class_6836;)V- named - scanCompressed- Lnet/minecraft/nbt/NbtIo;scanCompressed(Ljava/io/InputStream;Lnet/minecraft/nbt/scanner/NbtScanner;)V
 
- 
writeCompressedWrites the Gzip-compressednbttofile.- Throws:
- IOException- if the IO operation fails
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lrb;a(Lqr;Ljava/io/File;)V- intermediary - method_30614- Lnet/minecraft/class_2507;method_30614(Lnet/minecraft/class_2487;Ljava/io/File;)V- named - writeCompressed- Lnet/minecraft/nbt/NbtIo;writeCompressed(Lnet/minecraft/nbt/NbtCompound;Ljava/io/File;)V
 
- 
writeCompressedWrites the Gzip-compressednbttostream.- Throws:
- IOException- if the IO operation fails
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lrb;a(Lqr;Ljava/io/OutputStream;)V- intermediary - method_10634- Lnet/minecraft/class_2507;method_10634(Lnet/minecraft/class_2487;Ljava/io/OutputStream;)V- named - writeCompressed- Lnet/minecraft/nbt/NbtIo;writeCompressed(Lnet/minecraft/nbt/NbtCompound;Ljava/io/OutputStream;)V
 
- 
writeWrites thenbttofile.- Throws:
- IOException- if the IO operation fails
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lrb;b(Lqr;Ljava/io/File;)V- intermediary - method_10630- Lnet/minecraft/class_2507;method_10630(Lnet/minecraft/class_2487;Ljava/io/File;)V- named - write- Lnet/minecraft/nbt/NbtIo;write(Lnet/minecraft/nbt/NbtCompound;Ljava/io/File;)V
 
- 
readReads an NBT compound fromfile.- Returns:
- the NBT compound from the file, or nullif the file does not exist
- Throws:
- IOException- if the IO operation fails or if the root NBT element is not a compound
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lrb;b(Ljava/io/File;)Lqr;- intermediary - method_10633- Lnet/minecraft/class_2507;method_10633(Ljava/io/File;)Lnet/minecraft/class_2487;- named - read- Lnet/minecraft/nbt/NbtIo;read(Ljava/io/File;)Lnet/minecraft/nbt/NbtCompound;
 
- 
readReads an NBT compound frominput.- Returns:
- the NBT compound from the input
- Throws:
- IOException- if the IO operation fails or if the root NBT element is not a compound
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lrb;a(Ljava/io/DataInput;)Lqr;- intermediary - method_10627- Lnet/minecraft/class_2507;method_10627(Ljava/io/DataInput;)Lnet/minecraft/class_2487;- named - read- Lnet/minecraft/nbt/NbtIo;read(Ljava/io/DataInput;)Lnet/minecraft/nbt/NbtCompound;
 
- 
readReads an NBT compound frominput.- Returns:
- the NBT compound from the input
- Throws:
- IOException- if the IO operation fails or if the root NBT element is not a compound
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lrb;a(Ljava/io/DataInput;Lra;)Lqr;- intermediary - method_10625- Lnet/minecraft/class_2507;method_10625(Ljava/io/DataInput;Lnet/minecraft/class_2505;)Lnet/minecraft/class_2487;- named - read- Lnet/minecraft/nbt/NbtIo;read(Ljava/io/DataInput;Lnet/minecraft/nbt/NbtTagSizeTracker;)Lnet/minecraft/nbt/NbtCompound;
 
- 
writeWrites thenbttofile.- Throws:
- IOException- if the IO operation fails
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lrb;a(Lqr;Ljava/io/DataOutput;)V- intermediary - method_10628- Lnet/minecraft/class_2507;method_10628(Lnet/minecraft/class_2487;Ljava/io/DataOutput;)V- named - write- Lnet/minecraft/nbt/NbtIo;write(Lnet/minecraft/nbt/NbtCompound;Ljava/io/DataOutput;)V
 
- 
scanScans the NBT input usingscanner.- Throws:
- IOException- if the IO operation fails
- API Note:
- This method does not return the scan result; the user is expected
 to call the appropriate method of the NbtScannersubclasses, such asNbtCollector.getRoot().
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lrb;a(Ljava/io/DataInput;Lrh;)V- intermediary - method_39855- Lnet/minecraft/class_2507;method_39855(Ljava/io/DataInput;Lnet/minecraft/class_6836;)V- named - scan- Lnet/minecraft/nbt/NbtIo;scan(Ljava/io/DataInput;Lnet/minecraft/nbt/scanner/NbtScanner;)V
 
- 
write- Throws:
- IOException
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lrb;a(Lrk;Ljava/io/DataOutput;)V- intermediary - method_10631- Lnet/minecraft/class_2507;method_10631(Lnet/minecraft/class_2520;Ljava/io/DataOutput;)V- named - write- Lnet/minecraft/nbt/NbtIo;write(Lnet/minecraft/nbt/NbtElement;Ljava/io/DataOutput;)V
 
- 
readprivate static NbtElement read(DataInput input, int depth, NbtTagSizeTracker tracker) throws IOException - Throws:
- IOException
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lrb;a(Ljava/io/DataInput;ILra;)Lrk;- intermediary - method_10626- Lnet/minecraft/class_2507;method_10626(Ljava/io/DataInput;ILnet/minecraft/class_2505;)Lnet/minecraft/class_2520;- named - read- Lnet/minecraft/nbt/NbtIo;read(Ljava/io/DataInput;ILnet/minecraft/nbt/NbtTagSizeTracker;)Lnet/minecraft/nbt/NbtElement;
 
 
-