code: public static void writeTag(OutputStream out, Tag tag, boolean littleEndian) throws IOException {
          writeTag((DataOutput) (littleEndian ? new LittleEndianDataOutputStream(out) : new DataOutputStream(out)), tag);
      }
docs: Writes an NBT tag.
  
  @param out          Output stream to write to.
  @param tag          Tag to write.
  @param littleEndian Whether to write little endian NBT.
  @throws java.io.IOException If an I/O error occurs.