Class NBTOutputStream

java.lang.Object
java.io.OutputStream
com.sk89q.jnbt.NBTOutputStream
All Implemented Interfaces:
Closeable, DataOutput, Flushable, AutoCloseable

@Deprecated(forRemoval=true) public final class NBTOutputStream extends OutputStream implements Closeable, DataOutput
Deprecated, for removal: This API element is subject to removal in a future version.
JNBT is being removed for adventure-nbt in WorldEdit 8.
This class writes NBT, or Named Binary Tag Tag objects to an underlying OutputStream.

The NBT format was created by Markus Persson, and the specification may be found at https://minecraft.gamepedia.com/NBT_format.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new NBTOutputStream, which will write data to the specified underlying output stream.
    NBTOutputStream(OutputStream os, boolean littleEndian)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Flush output.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    write(byte[] b)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    write(byte[] b, int off, int len)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    write(int b)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeBoolean(boolean v)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeByte(int v)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeChar(int v)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeDouble(double v)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeFloat(float v)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeInt(int v)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeLong(long v)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeNamedTag(String name, byte value)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeNamedTag(String name, byte[] bytes)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeNamedTag(String name, int value)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeNamedTag(String name, int[] data)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeNamedTag(String name, long value)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeNamedTag(String name, short value)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeNamedTag(String name, Tag tag)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a tag.
    void
    writeNamedTag(String name, String value)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeNamedTagName(String name, int type)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    writeShort(int v)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes tag payload.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.io.OutputStream

    nullOutputStream

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NBTOutputStream

      public NBTOutputStream(OutputStream os) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new NBTOutputStream, which will write data to the specified underlying output stream.
      Parameters:
      os - The output stream.
      Throws:
      IOException - if an I/O error occurs.
    • NBTOutputStream

      public NBTOutputStream(DataOutput os)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • NBTOutputStream

      public NBTOutputStream(DataOutputStream os)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • NBTOutputStream

      public NBTOutputStream(OutputStream os, boolean littleEndian) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
  • Method Details

    • getOutputStream

      public DataOutput getOutputStream()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • writeNamedTag

      public void writeNamedTag(String name, Tag tag) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes a tag.
      Parameters:
      tag - The tag to write.
      Throws:
      IOException - if an I/O error occurs.
    • writeNamedTag

      public void writeNamedTag(String name, String value) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • writeNamedTag

      public void writeNamedTag(String name, int value) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • writeNamedTag

      public void writeNamedTag(String name, byte value) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • writeNamedTag

      public void writeNamedTag(String name, short value) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • writeNamedTag

      public void writeNamedTag(String name, long value) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • writeNamedTag

      public void writeNamedTag(String name, byte[] bytes) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • writeNamedTag

      public void writeNamedTag(String name, int[] data) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • writeNamedEmptyList

      public void writeNamedEmptyList(String name) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • writeNamedTagName

      public void writeNamedTagName(String name, int type) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • writeLazyCompoundTag

      public void writeLazyCompoundTag(String name, NBTOutputStream.LazyWrite next) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • writeTag

      public void writeTag(Tag tag) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • writeEndTag

      public void writeEndTag() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • writeTagPayload

      public void writeTagPayload(Tag tag) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes tag payload.
      Parameters:
      tag - The tag.
      Throws:
      IOException - if an I/O error occurs.
    • close

      public void close() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class OutputStream
      Throws:
      IOException
    • write

      public void write(int b) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      write in interface DataOutput
      Specified by:
      write in class OutputStream
      Throws:
      IOException
    • write

      public void write(byte[] b) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      write in interface DataOutput
      Overrides:
      write in class OutputStream
      Throws:
      IOException
    • write

      public void write(byte[] b, int off, int len) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      write in interface DataOutput
      Overrides:
      write in class OutputStream
      Throws:
      IOException
    • writeBoolean

      public void writeBoolean(boolean v) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      writeBoolean in interface DataOutput
      Throws:
      IOException
    • writeByte

      public void writeByte(int v) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      writeByte in interface DataOutput
      Throws:
      IOException
    • writeShort

      public void writeShort(int v) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      writeShort in interface DataOutput
      Throws:
      IOException
    • writeChar

      public void writeChar(int v) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      writeChar in interface DataOutput
      Throws:
      IOException
    • writeInt

      public void writeInt(int v) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      writeInt in interface DataOutput
      Throws:
      IOException
    • writeLong

      public void writeLong(long v) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      writeLong in interface DataOutput
      Throws:
      IOException
    • writeFloat

      public void writeFloat(float v) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      writeFloat in interface DataOutput
      Throws:
      IOException
    • writeDouble

      public void writeDouble(double v) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      writeDouble in interface DataOutput
      Throws:
      IOException
    • writeBytes

      public void writeBytes(String s) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      writeBytes in interface DataOutput
      Throws:
      IOException
    • writeChars

      public void writeChars(String s) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      writeChars in interface DataOutput
      Throws:
      IOException
    • writeUTF

      public void writeUTF(String s) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      writeUTF in interface DataOutput
      Throws:
      IOException
    • flush

      public void flush() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Flush output.
      Specified by:
      flush in interface Flushable
      Overrides:
      flush in class OutputStream
      Throws:
      IOException