Package net.minecraft.nbt
Class NbtAccounter
java.lang.Object
net.minecraft.nbt.NbtAccounter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private static final int
private final int
private final long
private long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
accountBytes
(long pBytes) Adds the bytes to the current number of read bytes.void
accountBytes
(long pBytesPerItem, long pItems) static NbtAccounter
create
(long pQuota) int
getDepth()
long
getUsage()
void
popDepth()
void
static NbtAccounter
-
Field Details
-
MAX_STACK_DEPTH
private static final int MAX_STACK_DEPTH- See Also:
-
quota
private final long quota -
usage
private long usage -
maxDepth
private final int maxDepth -
depth
private int depth
-
-
Constructor Details
-
NbtAccounter
public NbtAccounter(long pQuota, int pMaxDepth)
-
-
Method Details
-
create
-
unlimitedHeap
-
accountBytes
public void accountBytes(long pBytesPerItem, long pItems) -
accountBytes
public void accountBytes(long pBytes) Adds the bytes to the current number of read bytes. If the number of bytes is greater than the stored quota, an exception will occur.- Throws:
RuntimeException
- if the number ofusage
bytes exceed the number ofquota
bytes
-
pushDepth
public void pushDepth() -
popDepth
public void popDepth() -
readUTF
-
getUsage
public long getUsage() -
getDepth
public int getDepth()
-