C# 클래스 fNbt.NbtFile

Represents a complete NBT file.
파일 보기 프로젝트 열기: fragmer/fNbt 1 사용 예제들

Private Properties

프로퍼티 타입 설명
DetectCompression NbtCompression
GetRootNameInternal string
LoadFromStreamInternal void
NbtFile System
ReadRootTagName string
ReadRootTagName string
SaveToBuffer byte[]
ToString string

공개 메소드들

메소드 설명
LoadFromBuffer ( [ buffer, int index, int length, NbtCompression compression ) : long

Loads NBT data from a byte array. Existing RootTag will be replaced. FileName will be set to null.

LoadFromBuffer ( [ buffer, int index, int length, NbtCompression compression, [ selector ) : long

Loads NBT data from a byte array. Existing RootTag will be replaced. FileName will be set to null.

LoadFromFile ( [ fileName ) : long

Loads NBT data from a file. Existing RootTag will be replaced. Compression will be auto-detected.

LoadFromFile ( [ fileName, NbtCompression compression, [ selector ) : long

Loads NBT data from a file. Existing RootTag will be replaced.

LoadFromStream ( [ stream, NbtCompression compression ) : long

Loads NBT data from a stream. Existing RootTag will be replaced

LoadFromStream ( [ stream, NbtCompression compression, [ selector ) : long

Loads NBT data from a stream. Existing RootTag will be replaced

NbtFile ( [ rootTag ) : System

Creates a new NBT file with the given root tag.

SaveToBuffer ( [ buffer, int index, NbtCompression compression ) : long

Saves this NBT file to a stream. Nothing is written to stream if RootTag is null.

SaveToFile ( [ fileName, NbtCompression compression ) : long

Saves this NBT file to a stream. Nothing is written to stream if RootTag is null.

SaveToStream ( [ stream, NbtCompression compression ) : long

Saves this NBT file to a stream. Nothing is written to stream if RootTag is null.

ToString ( ) : string

Prints contents of the root tag, and any child tags, to a string.

비공개 메소드들

메소드 설명
DetectCompression ( [ stream ) : NbtCompression
GetRootNameInternal ( [ stream, bool bigEndian ) : string
LoadFromStreamInternal ( [ stream, [ tagSelector ) : void
NbtFile ( ) : System
ReadRootTagName ( [ fileName ) : string
ReadRootTagName ( [ fileName, NbtCompression compression, bool bigEndian, int bufferSize ) : string
SaveToBuffer ( NbtCompression compression ) : byte[]
ToString ( [ indentString ) : string

메소드 상세

LoadFromBuffer() 공개 메소드

Loads NBT data from a byte array. Existing RootTag will be replaced. FileName will be set to null.
is null. If an unrecognized/unsupported value was given for ; /// if or is less than zero; /// if the sum of and is greater than the length of . If NBT stream extends beyond the given . If file compression could not be detected or decompressing failed. If an error occurred while parsing data in NBT format.
public LoadFromBuffer ( [ buffer, int index, int length, NbtCompression compression ) : long
buffer [ Stream from which data will be loaded. If is set to AutoDetect, this stream must support seeking.
index int The index into at which the stream begins. Must not be negative.
length int Maximum number of bytes to read from the given buffer. Must not be negative. /// An is thrown if NBT stream is longer than the given length.
compression NbtCompression Compression method to use for loading/saving this file.
리턴 long

LoadFromBuffer() 공개 메소드

Loads NBT data from a byte array. Existing RootTag will be replaced. FileName will be set to null.
is null. If an unrecognized/unsupported value was given for ; /// if or is less than zero; /// if the sum of and is greater than the length of . If NBT stream extends beyond the given . If file compression could not be detected or decompressing failed. If an error occurred while parsing data in NBT format.
public LoadFromBuffer ( [ buffer, int index, int length, NbtCompression compression, [ selector ) : long
buffer [ Stream from which data will be loaded. If is set to AutoDetect, this stream must support seeking.
index int The index into at which the stream begins. Must not be negative.
length int Maximum number of bytes to read from the given buffer. Must not be negative. /// An is thrown if NBT stream is longer than the given length.
compression NbtCompression Compression method to use for loading/saving this file.
selector [ Optional callback to select which tags to load into memory. Root may not be skipped. /// No reference is stored to this callback after loading (don't worry about implicitly captured closures). May be null.
리턴 long

LoadFromFile() 공개 메소드

Loads NBT data from a file. Existing RootTag will be replaced. Compression will be auto-detected.
is null. If given file was not found. If file ended earlier than expected. If file compression could not be detected, or decompressing failed. If an error occurred while parsing data in NBT format. If an I/O error occurred while reading the file.
public LoadFromFile ( [ fileName ) : long
fileName [ Name of the file from which data will be loaded.
리턴 long

LoadFromFile() 공개 메소드

Loads NBT data from a file. Existing RootTag will be replaced.
is null. If an unrecognized/unsupported value was given for . If given file was not found. If file ended earlier than expected. If file compression could not be detected, or decompressing failed. If an error occurred while parsing data in NBT format. If an I/O error occurred while reading the file.
public LoadFromFile ( [ fileName, NbtCompression compression, [ selector ) : long
fileName [ Name of the file from which data will be loaded.
compression NbtCompression Compression method to use for loading/saving this file.
selector [ Optional callback to select which tags to load into memory. Root may not be skipped. /// No reference is stored to this callback after loading (don't worry about implicitly captured closures). May be null.
리턴 long

LoadFromStream() 공개 메소드

Loads NBT data from a stream. Existing RootTag will be replaced
is null. If an unrecognized/unsupported value was given for . If is set to AutoDetect, but the stream is not seekable. If file ended earlier than expected. If file compression could not be detected, decompressing failed, or given stream does not support reading. If an error occurred while parsing data in NBT format.
public LoadFromStream ( [ stream, NbtCompression compression ) : long
stream [ Stream from which data will be loaded. If compression is set to AutoDetect, this stream must support seeking.
compression NbtCompression Compression method to use for loading/saving this file.
리턴 long

LoadFromStream() 공개 메소드

Loads NBT data from a stream. Existing RootTag will be replaced
is null. If an unrecognized/unsupported value was given for . If is set to AutoDetect, but the stream is not seekable. If file ended earlier than expected. If file compression could not be detected, decompressing failed, or given stream does not support reading. If an error occurred while parsing data in NBT format.
public LoadFromStream ( [ stream, NbtCompression compression, [ selector ) : long
stream [ Stream from which data will be loaded. If compression is set to AutoDetect, this stream must support seeking.
compression NbtCompression Compression method to use for loading/saving this file.
selector [ Optional callback to select which tags to load into memory. Root may not be skipped. /// No reference is stored to this callback after loading (don't worry about implicitly captured closures). May be null.
리턴 long

NbtFile() 공개 메소드

Creates a new NBT file with the given root tag.
If given is unnamed.
public NbtFile ( [ rootTag ) : System
rootTag [ Compound tag to set as the root tag. May be null.
리턴 System

SaveToBuffer() 공개 메소드

Saves this NBT file to a stream. Nothing is written to stream if RootTag is null.
is null. If AutoDetect was given as the mode. If an unrecognized/unsupported value was given for ; /// if is less than zero; or if is greater than the length of . If given stream does not support writing. Specified file is read-only, or a permission issue occurred. If one of the NbtCompound tags contained unnamed tags; /// or if an NbtList tag had Unknown list type and no elements.
public SaveToBuffer ( [ buffer, int index, NbtCompression compression ) : long
buffer [ Buffer to write data to. May not be null.
index int The index into at which the stream should begin.
compression NbtCompression Compression mode to use for saving. May not be AutoDetect.
리턴 long

SaveToFile() 공개 메소드

Saves this NBT file to a stream. Nothing is written to stream if RootTag is null.
is null. If AutoDetect was given as the mode. If an unrecognized/unsupported value was given for . If given stream does not support writing. If an I/O error occurred while creating the file. Specified file is read-only, or a permission issue occurred. If one of the NbtCompound tags contained unnamed tags; /// or if an NbtList tag had Unknown list type and no elements.
public SaveToFile ( [ fileName, NbtCompression compression ) : long
fileName [ File to write data to. May not be null.
compression NbtCompression Compression mode to use for saving. May not be AutoDetect.
리턴 long

SaveToStream() 공개 메소드

Saves this NBT file to a stream. Nothing is written to stream if RootTag is null.
is null. If AutoDetect was given as the mode. If an unrecognized/unsupported value was given for . If given stream does not support writing. If RootTag is null; /// or if RootTag is unnamed; /// or if one of the NbtCompound tags contained unnamed tags; /// or if an NbtList tag had Unknown list type and no elements.
public SaveToStream ( [ stream, NbtCompression compression ) : long
stream [ Stream to write data to. May not be null.
compression NbtCompression Compression mode to use for saving. May not be AutoDetect.
리턴 long

ToString() 공개 메소드

Prints contents of the root tag, and any child tags, to a string.
public ToString ( ) : string
리턴 string